Even if you could stay airside, max is something like 7 or 9 hours without a visa. To check-in for a second airline with 2 separately-ticketed flights, you will likely have to leave secure area, Can't imagine how Aeromexico agents would get you through Customs, much less Immigration. Better confirm with Brazilian embassy. No visas issued at the airport. If visa required and you don't have one, you may not get on first flight.