LAS VEGAS — The images of the two U.S. soccer teams could not have been more strikingly different, hours and continents apart, one dream realized against an ancient rival and another dashed by a long-neglected neighbor, both by 1-0 scores.

Golden confetti showered a young, inspiring U.S. men’s squad in a deafening venue across the highway from the Las Vegas Strip. Medals dangled from the players’ necks as they hoisted the Concacaf Gold Cup trophy toward the roof of a sold-out domed stadium following an extra-time victory over Mexico.

Thousands of miles away, while the men celebrated into the desert night, an aging U.S. women’s team looked tired and broken, trudging through an Olympic semifinal in an empty Japanese arena before falling to Canada and ending a 20-year series reign.

Commonly, it’s been the other way around — the women brandishing a gold medal or World Cup crown while the men convalesced.

Sunday night and Monday morning, a sleepless stretch for U.S. soccer die-hards, the roles were reversed. Both were involved in upsets, but in the bigger picture, the men continued to chart a promising course forward while the women hit a reckoning point.

The four-time world champion women arrived at the Tokyo Olympics with a 2½-year unbeaten streak and hadn’t been shut out in four years. In five matches, however, they went 1-2-2, the lone victory in regulation time coming against badly overmatched New Zealand. In three of the four other matches, the Americans didn’t score.

They’ll play Australia on Thursday for the bronze medal, one step beyond the 2016 Olympics, when they were upset by Sweden in a quarterfinal shootout, but still bitterly disappointing for a program that won the past two World Cup titles.

In the buildup to his first major tournament, Coach Vlatko Andonovski inherited a veteran squad featuring Megan Rapinoe, Carli Lloyd and Alex Morgan, among others. With those players past their prime but still performing at a high level, he was not going to leave them behind. A younger troupe, led by Rose Lavelle and Samantha Mewis, would provide counterbalance.

The Olympics, though, were a flop. From the opening match, when they were smashed by Sweden, the Americans never seemed quite right. They looked uncomfortable with Andonovski’s tactics.

The only consistent standout was goalkeeper Alyssa Naeher, whose penalty-kick heroics rescued the quarterfinal against the Netherlands. Alas, she left the Canada match with a first-half injury. Naeher’s departure did not lose the match — backup Adrianna Franch conceded a late penalty kick — but it was an ominous sign.

What stood out in many matches was the body language of the opponents. Instead of cowering to the U.S. aura, they performed with supreme confidence and exposed vulnerabilities.

For a few years, there has been a growing narrative that the rest of the world, particularly Europe, is catching up to the United States in women’s soccer. While that is true to some extent — Spain and the Netherlands, for instance — the U.S. program requires introspection.

Andonovski might have a hard time retaining his job. In a program with high standards and expectations, failure to reach a final is close to calamitous. No matter who is in charge, personnel changes are due — or perhaps overdue. Preparations for the 2023 World Cup will begin this fall.

The men have a brighter outlook. Gregg Berhalter’s summer plan of fielding separate teams in two regional competitions worked brilliantly as the Americans defeated strong Mexican squads in consecutive finals two months apart.

His full-strength unit won the Nations League in Denver, and his secondary crew captured the Gold Cup trophy. In the latter, he was able to expose young players to international competition ahead of 2022 World Cup qualifiers starting next month while still winning the seventh title in program history. The fact both came against its nemesis sweetened the celebrations.

Some from this roster will join the full squad, which features players such as Christian Pulisic, Gio Reyna and Weston McKennie, for training camp late this month in Nashville and the opener Sept. 2 in El Salvador. Given the new, compact qualifying schedule — 14 matches in five windows over seven months — Berhalter prioritized expanding the depth chart.

“This tournament is in the past, and now we shift toward qualifying,” Berhalter said. “We know it’s going to be grueling, but we think the player pool has matured and it’s been battle-tested, and now we move on.”

With his top players in Europe preparing for club seasons, Berhalter provided a forum for many MLS standouts. The big winners were Matt Turner, who was voted the Gold Cup’s best goalkeeper; center back Miles Robinson, who scored the 117th-minute winner against Mexico; and midfielder Kellyn Acosta, a two-way standout.

Berhalter got long looks at newcomers such as defenders James Sands and Sam Vines and German-based forward Matthew Hoppe. Veterans Sebastian Lletget, Paul Arriola and Gyasi Zardes showed their value as the team extended its winning streak to nine and improved its record since January 2020 to 14-1-1.

The resurgence comes in the aftermath of a failed 2018 World Cup qualifying campaign that ended a string of seven consecutive appearances and precipitated a full reexamination of the program.

Things are looking up with this new generation and new coach. The women are now on the clock.