KUALA LUMPUR, Malaysia—Around 2 a.m. Thursday, the global ramifications of a shocking political turn started to unfold: A 92-year-old former prime minister, returning after a long absence, would reclaim office and upset the balance of power in a strategically vital region—rethinking deals with neighboring China and accelerating investigations of a sweeping international corruption scandal.

The parliamentary election brought back to power Mahathir Mohamad, Malaysia’s ruler from 1981 to 2003, who had soured on his onetime protégé...