Marquez only needed two points from the final two rounds to secure the title.
But he did not look like he planned to take it easy as his Monlau Suter burst into the lead for a few yards at the start.
Espargaro's Pons Kalex slipped back from pole to fourth during the first lap, but by the end of lap two the Spaniard was in the lead.
Up to a second per lap faster than his rivals, Espargaro was unstoppable in the race and won by a huge 16 seconds.
Marquez had it all in hand, though. He spent most of the race sat in third place behind Scott Redding's Marc VDS Kalex.
Local favourite Anthony West joined them in the closing laps, as he rode a superb race for QMMF to break away from the large pack fighting for fourth.
With nothing to lose and Australian pride to uphold, West battled past before Marquez and Redding into second place in the closing laps.
Marquez sat back in fourth until the final two corners, when he showed just how easy he had been taking it by shooting past Redding, then coming within 0.026s of beating West over the line.
Dominique Aegerter eventually came fifth, ahead of Johann Zarco, Simone Corsi, Esteve Rabat, Randy Krummenacher and Takaaki Nakagami, who led much of lap one after a brilliant start. Mika Kallio was at the forefront of this group before a late clash with Corsi.
Second-row starter Tom Luthi drifted back then crashed, which was a relief for Andrea Iannone, his rival for third in the standings, who stopped with an apparent engine failure early on.