The journey for more than 6,000 migrants came to a halt here in Tijuana in mid-November. For weeks, most watched the hours and days pass in a municipal sports complex that had been converted into a shelter. Food was scarce. Privacy was nonexistent. Respiratory diseases flourished.

If any migrants still thought Mr. Trump might be moved by their plight, they were disabused of that notion a week ago, when hundreds broke away from a peaceful march and ran toward the American border. They were repelled by United States border guards firing tear gas, and scores of migrants were arrested by the Mexican authorities.

Several days later, a big rainstorm descended on the city, turning the sports complex into a swamp and adding to the migrants’ misery.

In light of the week’s events, and Mr. Trump’s continuing tough rhetoric, the migrants have started re-evaluating their options amid growing frustration and desperation.

Hundreds have called it quits and signed up to be voluntarily repatriated to their homelands.

Many others have decided that their best course of action is to take the Mexican government up on its offer of one-year humanitarian visas that permit them to stay and work in Mexico, even if, for some, it is just to bide their time until they can try to enter the United States.

And more than 2,000 have sought appointments with American immigration officials to petition for asylum, though Mr. Trump has made this more difficult, and wait times for an interview now stretch to more than two months.

But some migrants have arrived at another conclusion: Their best bet now, they believe, is to try to cross the border illegally.