Ochoa's resolve was finally breached through Neymar, who tucked home Willian's cross with an outstretched leg on 51 minutes. After being disqualified from qualifying in 1990, Mexico have suffered seven successive defeats in the round of 16 stage since 1994.
While Mexico's frenetic gusto generated some early chances as Brazil struggled.
The substitute Firmino added the clincher in the 88th minute on a carbon copy goal: this time it was Neymar who burst in on the left and Firmino who slid into the goalmouth to turn the ball home.
Brazil has always been the most successful team in World Cup history, having won five editions of the tournament, one more than both Germany and Italy.
After sparking Germany's humiliating World Cup exit by beating the defending champions 1-0 in their opener, Mexico are now threatening Brazil's bid for a sixth World Cup.
Brazil will be favorites to advance, but Mexico have already shocked the world once this tournament and should not be counted out.More news: Germany v South Korea
More news: Germany Have Been Knocked Out Of The 2018 World Cup
More news: Germany boss opens up on team performance
Focused and fearless, Mexico continued to trouble Brazil in the opening stages, with Fagner in particular struggling massively to cope with the threat down his side.
Mexico's World Cup is over, ending in a 2-0 loss to Brazil on a sultry Monday evening at Cosmos Arena.
Brazil maintained the pressure in the second half as Ochoa parried away Coutinho's shot.
Paulinho should have doubled the lead when he was left alone near the penalty spot, but Ochoa once again came up with the save.
Opponents Mexico make two changes from the 0-3 loss to Sweden, with Hugo Ayala replacing the suspended Hector Moreno in central defence and captain Rafael Marquez also coming into the side.
As Mexico threw bodies forward in search of a late leveller, Brazil took full advantage of the gaps in their backline to score a second with two minutes remaining.