MADISON, Wis. — The road has been a treacherous place for all Big Ten men’s basketball programs this season, and particularly for Maryland, which arrived at Wisconsin without a road victory in three attempts, including a pair of conference games.

The No. 17 Terrapins showed promise they had lacked in previous outings, but the lead they had secured unraveled in the final moments, sending Maryland back to College Park with a 56-54 loss Tuesday night.

Wisconsin’s Brad Davison made the go-ahead corner three-pointer with 11 seconds left. The Badgers had possession because, when Maryland’s Darryl Morsell needed to inbound from underneath his team’s basket with 13 seconds to go, Davison deflected a pass intended for a double-teamed Anthony Cowan Jr. — and the ball hit Morsell while he was out of bounds.

Coach Mark Turgeon said he “didn’t draw a good enough play.” The Terps had a timeout but didn’t use it. Cowan said that was “my fault as a leader.” But Morsell, Turgeon or anyone else could have called it, too.

Maryland’s one-point lead evaporated a few seconds later. Cowan, the senior guard who is trusted in game-on-the-line situations, attempted a long straightaway three-pointer with three seconds remaining but missed.

“That’s my shot,” Cowan said. “That’s my spot. I usually make it.”

Turgeon, who used his final timeout before that possession, said it wasn’t the look he had hoped for, but he was glad Cowan had the confidence to take the shot. Before the play, Turgeon said, he talked to his team about “getting into overtime, trying to get to the rim or get fouled.”

But results are rooted in reality, not what-ifs. Morsell couldn’t connect with Cowan on the inbound pass. Cowan didn’t add another game-changing shot to his résumé. The Terps left with what Turgeon called a “devastating loss.”

Maryland (13-4, 3-3 Big Ten) hadn’t played well in road environments but assembled a showing that gave it a chance to win until the end.

“We’ve stunk on the road until tonight,” Turgeon said. “And tonight we were much better and gave ourselves a chance. It’s a step in the right direction.”

Jalen Smith and Cowan delivered in the second half, when the two combined for 20 points. Smith scored a game-high 18 points and added nine rebounds, and sophomore guard Aaron Wiggins emerged from his slump. But Davison’s three sent Kohl Center into a roar and rendered all of that work useless.

On the road, the Terps have struggled far more than expected, given how most players in the rotation had meaningful roles a year ago. But when Maryland played its previous three road games — at Penn State, Seton Hall and Iowa — poor shooting and sloppy play led to its demise.

Maryland certainly didn’t surge ahead against Wisconsin (11-6, 4-2); the Terps had a few field goal droughts in the first half that left them in a five-point hole at halftime. But Maryland also didn’t let the game get out of hand early the way it did Friday at Iowa. Instead, the Maryland defense never let the Badgers’ lead grow to more than eight points, but the Terps finished just short of earning an important win.

After Turgeon called on the same starters for five straight games, he switched his group against Wisconsin, starting Eric Ayala in place of Wiggins, who had started every game this season but has struggled lately. Ayala has slumped a bit, too, particularly from three-point range, but Turgeon said Ayala had his best practice of the season Sunday. Ayala only scored two points against Wisconsin on another difficult night, but Wiggins made his trouble look like part of the forgotten past.

“I just competed all-around, rebounding, defensively, guarding the ball, hitting shots when I’m open, just all those little things,” Wiggins said. “I was just more engaged.”

After Wiggins was held scoreless for the first time in his career at Iowa, he scored 13 points Tuesday. Wiggins hit two threes in the first half, including one in the final minute that cut Wisconsin’s lead to five.

Smith nearly cut the lead further on the Terps’ final possession of the half. A play out of a Maryland timeout gave him an open look from deep, but the sophomore forward missed, an anomaly for him Tuesday. Smith made his other two attempts from three-point range, one of which tied the score early in the second half.

That opened the door for Cowan to hit a few characteristic critical shots, scoring nine points in four minutes. His three-pointer followed Smith’s and gave Maryland its first lead since the opening minutes. Cowan finished with 16 points but couldn’t be the hero in the final seconds.

Earlier this season, the Terps rose as high as No. 3 in the Associated Press poll and traveled to Penn State with a 10-0 record. Once there, they suffered their first loss of the season, and another defeat followed the next week at Seton Hall before a few wins helped revive a sense of optimism around the program. “We thought we were making a turn,” Turgeon said, but then Maryland trudged through that disappointing display at Iowa.

Yet thanks to early chaos in the conference, Maryland is still the second-highest-ranked team in the Big Ten, only trailing No. 15 Michigan State. This game could have lifted Maryland back into a reassuring spot in the conference pecking order, and the Terps’ ability to play better on the road could help them in the coming months.

But for now, all these Terps have is another loss and another gloomy plane ride home.

“We were just one possession away from being a lot happier," Turgeon said. “That’s for sure.”

More college sports from The Post: