Valtteri Bottas won for the first time since April to reduce the championship deficit to Hamilton to 64 points with 104 available.
Pole-sitter Sebastian Vettel held off a late fightback by Hamilton to finish runner-up, just 0.4 seconds ahead of the Briton.
Hamilton will win his sixth world title in Mexico in a fortnight’s time if he outscores Bottas by 14 points. If Hamilton wins, and Bottas is fifth or lower, the Briton will move to within one triumph of Michael Schumacher’s record.
Despite Hamilton’s frustration here, his Mercedes team were crowned constructors’ champions for a sixth successive time.
London-born Thai Alex Albon finished a career-best fourth for Red Bull ahead of McLaren’s Carlos Sainz.
Charles Leclerc was sixth after he collided with Red Bull driver Max Verstappen at the first corner. The Dutchman was forced to retire with the damage to his car.