The Falcons would have been able to qualify for the last 16 with a draw, if Poland were victorious against Argentina, while for El Tri nothing but a win was enough to give them any chance of progression and they go out in cruel style.
Henry Martin notched the first goal of the game, firing home from close range after Cesar Montes headed it down, before Luis Chavez added a second minutes later when an unbelievable long-range free kick was struck with venom into the top right corner.
Saudi Arabia's Salem Al-Dawsari struck late to break Mexican hearts, despite it being all too late for his team, ensuring both teams exited the competition.
With both teams, in all likelihood, needing to win the match to progress to the last 16, it was an end-to-end affair from the off, and both goalkeepers were called into question in the early exchanges.
Alexis Vega had the first real opportunity of the game for Mexico, but his effort from the edge of the box was kept out well by Mohammed Al Owais.
El Tri committed bodies forward in the hopes of getting an early goal, which led to Saudi Arabia threatening on the break, with Saud Abdulhamid being brought down by Luis Chavez just outside the penalty area.
Mohammed Kanno was the man who stepped forward to take the resultant free kick, which was fired only narrowly over the bar, with goalkeeper Guillermo Ochoa left rooted to his spot.
Throughout the match, both managers will have been keeping one eye on how the other game in Group C developed, and there was a huge moment as the game approached half time when Lionel Messi missed a penalty, however Argentina did take the lead just after the break, through Alexis Mac Allister.
Although the fellow Group C side appeared to kick into gear in the second half, so did Mexico, and Saudi Arabia were left shell shocked by two goals in quick succession during the opening stages.
Henry Martin was blessed with having an easy finish from inside the box after Cesar Montes headed down a cross, but Luis Chavez's goal was far from simple.
The midfielder connected with the ball perfectly from at least 25 yards out to fire home a free kick, scoring his first ever goal for his country with one of the best strikes of the World Cup so far.
Given the circumstances in the other game, at this point Mexico needed just one more goal to seal a place in the knockout stages, and they thought they had it when Hirving Lozano had the ball in the back of the net, but he was offside by a tight margin and the game remained 2-0.
When Argentina added another through Julian Alvarez, Gerardo Martino's Mexico side were still heading out of the competition due to the fact that they had picked up more yellow cards than Poland, so they threw everything at the game to get an all-important extra goal.
As the game reached its finale, the Falcons knew that their race was run, but Mexico continued to fight for their lives, piling the pressure on as they committed a sea of bodies forward.
The Mexico fans thought their had moment had come when Uriel Antuna had the ball in the back of the net late on, but he slightly mistimed his run, and the goal was rightly chalked off for offside.
It was not to be for Mexico, who could not craft one final opportunity in the seven additional minutes, and they exit the World Cup at the group stage for the first time since 1978, with Salem Al-Dawsari firing home from close range in stoppage time to seal their fate.