Pole sitter Hamilton briefly took to the grass as he locked up under pressure, Rosberg also went off as he tangled with Red Bull's Max Verstappen in the opening skirmishes.
But otherwise two-time defending champion Hamilton was untroubled in the 71-lap race at the Autodromo Hermanos Rodriguez with Rosberg limiting his losses with second place.
The German has a 19-point lead over his team rival with just two rounds remaining as he bids for his first world title.
Verstappen, cleared by race stewards of any blame for the first corner incident with Rosberg, had quite a race, attempting to pass the title leader for second on lap 50 but not making it stick.
But controversy was to follow for the Dutch teenager as he clashed with Ferrari's Sebastian Vettel and took to the grass again to defend third place.
Vettel was furious, taking to race radio to berate Verstappen in strong terms, not the first time the pair have locked horns this season.
But the German himself was then under pressure from Verstappen's teammate Daniel Ricciardo, appearing to block the Australian as he tried to pass.
Verstappen was eventually given a five-second penalty by stewards, dropping to fifth to leave Vettel to race to the podium after being initially elevated to third place, with an unhappy Ricciardo in fourth for Red Bull.
Verstappen also hit back in the war of words with Vettel, telling Sky Sports he was not setting a good example.
"I will speak to him because this is how ridiculous he is handling it, he is just a very frustrated guy at the moment."
The final twist of the saga saw Vettel later handed a 10-second penalty for moving while in the braking zone, dropping him down to fifth and elevating Ricciardo to third in the official classification.
In truth and despite the late drama, the 130,000 fans who packed the grandstands saw another race which emphasized the dominance of the Mercedes pair, who are fighting it out for the title, the Constructors' crown long since decided.
It was the 17th win from 19 races for the German manufacturer, breaking its own record of 16 achieved the past two seasons.
Hamilton was claiming his first win in Mexico, his 51st career win, drawing him level with the great Alain Prost to second equal on the all-time list, as he bids for a fourth world title.
"This is honestly the best crowd we get anywhere. In our home country it is always great, but these guys have such a great passion I love it here," he said at the podium presentations.
"Nico is doing a great job. I'm really grateful the team did a great job."
Rosberg took control of the title race after a series of engine mishaps for his British rival in mid-season.
Hamilton hit back with victory in the United States Grand Prix in Texas last week,
but needs his teammate to drop points in Brazil and Abu Dhabi, with only a maximum of 50 points on offer.