MEXICO CITY—The front-runner in July’s presidential election wants to upend Mexico’s newly-opened energy sector.

Andres Manuel López Obrador, a leftist nationalist with a comfortable lead in the polls, has rattled investors by calling for a temporary freeze in new private investment in exploration and production of oil. But it is his plan to shift federal spending to refining from exploration and production that critics say could have the most dramatic consequences for the Mexican economy and U.S. refineries along the U.S....