A 28-year-old former Foreign Ministry official is set to become the country's youngest mayor after beating the 61-year-old incumbent in an election in Osaka Prefecture.