Frenchman Vincent Luis won the race in 1:44:34, 14 seconds before Mola, while South African Richard Murray finished third.
"It was a great season and ended up second behind my training partner – it was a great race," said Mola.
"I'll try to do it four times in a row next year, and it's in my hands to come back next year and get better."
Mola, who won the Junior World Championship title on the Gold Coast nine years ago, joined fellow countryman Javier Gomez as the only man to have won three consecutive world championship titles.
The 28-year-old finished the standings with 6,081 points, 1,021 points behind second-placed Luis. Australian Jake Birtwhistle finished third with 4,884, followed by Murray with 4,792.
Two-time Olympic champion Alistair Brownlee was fined 15 seconds for not going around a buoy while swimming.
The penalty was then upgraded to a disqualification and the Briton decided against a call, although he continued his race.