A power company was forced to switch off power to about 10,000 customers in the heart of Melbourne after a burst water main threatened to flood a substation.