Malaysia's Mahathir Mohamad will be sworn in as the world's oldest elected leader after his opposition alliance pulled off a stunning election win, ending six decades of rule by a coalition he once led.