Before you play a fifth game, you have to get to a fourth game. Ideally, then, you don’t want to implode in your third game …

For six successive World Cups, Mexico have been eliminated in the last 16, and now, thanks to South Korea, they will get a chance at reaching the quarter-finals, something that has become a holy grail in Mexican football. They did their best to get in their own way however, and by the time they collapsed to the turf against Sweden they were truly grateful that their own calamitous meltdown had been matched by an even more bizarre one from the reigning world champions, Germany.

Of all the scenarios going into Mexico’s final group game, the most unthinkable one was that El Tri would capitulate, having lit up the tournament so far, and yet still advance to the knockout stages courtesy of Germany losing to South Korea. This was an epic Great Escape.

Yet once the Mexican fans who deliriously celebrated the news of South Korea’s late goals calm down, they will be left wondering how Juan Carlos Osorio is going to lift a team whose confidence had evaporated so quickly.

It’s no secret that Osorio has been a polarizing figure as Mexico coach, chiefly for the professorial tinkering that occasionally seems to outstrip his team’s ability to comprehend his arcane planning. Yet the first two games of the tournament, in which Mexico stunned Germany with blistering counters, then efficiently dispatched South Korea, had done much to erase any lingering memories of the 7-0 Copa América collapse against Chile in 2016.

Ironically, Osorio had deviated from his usual instincts against Sweden, in resisting the urge to tinker with his line-up. In the first half the team appeared to have weathered Sweden’s onslaught, only for an unkind deflection, a penalty and an own goal to utterly dismantle them by the end of the second.

By the end of the game, Mexico looked bedraggled. The swashbuckling counters that had been the hallmark of their opening games had turned utterly ragged, and many of their players had resorted to fouling in frustration at Sweden’s physical control of the match.

Edson Álvarez was perhaps the most dramatic illustration of the malaise. He had come into the game relishing his coach’s faith in him after his introduction to the team to face South Korea. He left in tears – a poor performance capped with an own goal and culpability in Sweden’s opener.

Other players saw their stock settle back to more realistic levels. Hirving ‘Chucky’ Lozano had burst on to the global stage with his goal against Germany, and has spent much of the last week being linked to ever more unlikely suitors. Against Sweden, he looked like what he is: an exciting talent with a deal still to learn about decision making.

Carlos Vela’s curling shots looked less like a potent weapon than a solitary trick for solid defenses to figure out and negate. Javier Hernández got into his usual positions but never looked like scoring. Indeed, his most notable contribution to the game was a suspect touch in his own box that led to a VAR review for a possible handball.

Any team can have an off day, but the luck conferred by South Korea can’t wholly cancel out the precipitous collective drop in confidence the Mexico team seemed to endure on Wednesday. Thus far in the tournament Osorio’s meticulousness had bred swelling confidence among his players, as they bought in to the idea that he understood his team and their opponents better than anybody. At his best, Osorio creates an impression of being a master mechanic. But when the wheels come off like this, the fine-tuning of the engine is kind of moot.

Mexico, like England, has a strong tabloid culture when it comes to its football. Osorio will be glad to be removed from some of the frothing despair this performance is sure to generate. But he and his players will be acutely aware that the mood back home will have shifted dramatically from the type of conversations speculating well beyond the fifth game. Anxiety is now the watchword once again.

The test for Osorio now is largely psychological. Can he rebuild the team’s confidence around the idea that this was an aberrant result? Can his players recreate the free-flowing counter attacks that brought them success against Germany and South Korea? Or, as against Sweden, will they collapse into anxiety when the pressure is on in the knockout stages, joining a long line of Mexican teams who have flattered to deceive?

“Lesson learned” said Lozano after the game. For Mexico’s sake, let’s hope so.