The Briton, who wrapped up the championship in Texas last month, lapped 0.123 of a second quicker than German team mate Nico Rosberg.
His best lap of one minute 12.070 was set on soft tyres in the final minutes.
Earlier, with some 20 minutes gone, he had crawled to a halt on the track and told the team over the radio that he had lost gears.
An electronic problem was diagnosed, fixed in the garage and Hamilton returned to set a best time before he then spun off at turn 11.