Claudia Sheinbaum has been elected president of Mexico, marking the first time a woman has been chosen to lead the country, the election institute said.