Some see a victory by Mr. López Obrador as offering perhaps the greatest threat of disruption to relations with the U.S. But the candidate has been fairly moderate and pragmatic on the subject of Mr. Trump lately, saying in a recent interview, “We are going to maintain a good relationship. Or rather, we will aim to have a good bilateral relationship because it is indispensable.”

Who’s Running?

If the polls are accurate, Mr. López Obrador, 64, will win the day with a landslide. Representing a left-right alliance led by his relatively new Morena party, he has cast himself as the only candidate who can break the status quo and lead the nation out of its frustrating stasis.

His strongest challenger is Ricardo Anaya, 39, whose quick ascent has inspired awe and hatred, particularly for the way he has deftly — many say ruthlessly — sidelined and disposed of his opponents along the way.

Representing a left-right alliance led by his right-leaning National Action Party, he, too, has presented himself as a break from the status quo, though a better-prepared, more forward-looking and safer option than Mr. López Obrador.

Coming in third place in most polls is Jose Antonio Meade, 49, the candidate for the governing PRI who has held various cabinet posts in two administrations. He has sought to separate himself from the deeply unpopular administration of Mr. Peña Nieto, even though he was a member of it until he launched his candidacy. But his campaign has not been able to escape the taint of this longstanding association.

Jaime Rodríguez Calderón, an independent candidate who took a leave of absence as governor of the state of Nuevo León to compete, has been bringing up the rear in the polls. He has barely registered on the electorate’s consciousness except at moments where his famously unbridled tongue has grabbed attention. He proposed during one presidential debate that thieves should be punished by having their hands chopped off.

What if Polls Are Wrong?

In his first run for president in 2006, Mr. López Obrador lost by less than 1 percent. But he did not go quietly.