Brazil looked a pale imitation of the side that defeated Croatia 3-1 in the tournament opener, although Mexico goalkeeper Guillermo Ochoa made a series of great saves to keep them out in a fantastic individual performance.
Mexico obviously had not read the script as they took the game to a stuttering Brazil, whose best effort came through a Neymar header which was saved on the line shortly before the break.
Mexico did not create as many chances but they did go close on a couple of occasions, most notably when Hector Herrera flashed a strike narrowly over the bar.
The result leaves both sides on four points in the group, with one game each left to play.
Fred, who was largely ineffective and was replaced by Jo midway through the second half, set the tone for what proved to be a largely frustrating match as he saw his early effort hit the side-netting.
Brazil later went agonisingly close on the counter-attack with Paulinho unable to get on the end of Neymar's cross before Mexico keeper Ochoa denied the Barcelona striker's header on the line from a testing Dani Alves cross.
Bernard came on for Ramires at the start of the second half and he came close to setting up Neymar with a wicked cross but, for a spell thereafter, Mexico took the upper hand with several long-range shots going close.
Ochoa made another good stop to deny Neymar in a goalmouth scramble as Brazil started to liven up, however Thiago Silva was caught out by a Mexico break and was lucky to escape with only a yellow card when he hacked down Javier Hernandez.
At the other end, Ochoa continued to thwart Brazil, saving his best until last with a fantastic reaction save to keep out Silva's header from a corner.