Crammed into a patch of shade outside their dormitory in a migrant shelter in southern Mexico, a small group of women from Honduras and El Salvador spent much of a recent sweltering afternoon slipping into languid snoozes punctuated by bouts of bawdy banter. It was, they said, the way they gathered strength despite the knowledge that their flight from extreme street gang violence and desperate poverty in their own countries is not only far from over, but looking ever more difficult to complete.

"We can't go back and now we can't go forward either," said Natalia, a Honduran in her 20s, as the conversation turned serious and the smiles faded away. "And every day that passes means more suffering and danger for the families we left behind."

For years, the US border has been notoriously tough to cross. The Mexican leg is notorious for the risk of falling into the hands of criminal gangs such as the Zetas cartel, who rape, murder and demand ransoms from relatives in the US, often with the complicity of officials themselves known for demanding bribes.

However, the fallout from the political furore unleashed in the US by this year's spike in children and families turning up in Texas is adding yet more challenges. This has less to do with US border controls getting even tighter than with the Mexican authorities bowing to US pressure and cracking down as well, according to the migrants in the shelter.

"The hunt is on in Mexico, and we are the prey," said Natalia. "Mexico is doing what the United States wants."

The most obvious part of the Mexican crackdown is an unprecedented drive to keep migrants from riding the infamous freight train that trundles through the country from near the Guatemalan border all the way to the US and has traditionally been the route of choice for the poorest and most vulnerable. The Mexican government announced that it would start keeping migrants off the train in July, at a time when the US right was loudly complaining that Mexico was turning a blind eye to the wave of child migrants passing through the country.

Some of the most shocking images of the phenomenon showed babies being hoisted on to the top of the train, known as The Beast. Checks began this month at points where the train usually stops and migrants board – locations such as the dilapidated old station at Tenosique, near the Guatemalan border, a couple of hundred yards from the shelter.

Alejandra, another of the many Hondurans in the shelter, narrowly escaped one of the first. Had one of the Franciscan friars who run the shelter not stopped them in time, she and her three male travelling companions would have grabbed their tiny backpacks with the barest of essentials and run straight into an operation involving immigration agents supported by federal police and the army.

The route taken through Mexico by the freight train branded 'the Beast'

Last week, Alejandra sighed in relief at having avoided almost certain deportation, but admitted she was getting very anxious about finding an alternative way of restarting her mission to get a job in the US. She was trying to raise money from relatives in the US, she said, so she could pay for a bus ticket and the bribes required to skirt the checkpoints. Her impatience, she said, stemmed from the need to pay the "rent" demanded by gangs in her barrio in the city of San Pedro Sula. Before leaving for Guatemala and then Mexico in early August, she said she had negotiated a three-month window of opportunity to come up with the cash. "If I don't send the cash by then, they say they will kill my daughter, mother and little brother," she said. "I thought I would be moving more quickly, because I thought I would be on the train."

The Mexican government would never accept that its new drive to shut the train to migrants has anything to do with US pressure. Mexico's interior minister, Miguel Ángel Osorio Chong, insisted last week: "It is designed to protect the rights and physical integrity of foreigners passing through the country."

The train is, indeed, very dangerous. Hundreds of migrants have lost their lives or their limbs after falling off, either when trying to board or due to falling asleep along the way. Some have been pushed off by robbers. Rapes are not uncommon. Yet migrant activists say that, for all its terrors, the train route at least keeps migrants visible and therefore a little less vulnerable.

"This is not a real solution," says Friar Aurelio Montero. "Maybe it will deter some migrants for a bit, but they will keep coming, and these kinds of actions will force them to take ever more dangerous routes that make them more vulnerable to the criminals and extortion by officials."

This is particularly true, he added, because the train crackdown is being accompanied by a flood of new migration checkpoints in the southern frontier zone.

For activists such as Montero, the only solution is for the Mexican government to provide Central American migrants with some form of document allowing them to travel freely through the country on buses, shielded from the gangs and without having to pay bribes. He admits that this is highly unlikely.

With the route north increasingly difficult and expensive, there is anecdotal evidence that an increasing number of Central Americans have given up on the idea of trying to get to the US and are instead hoping to stay in Mexico. Even this, however, requires migrants to get beyond the delicate southern frontier zone to a big city, where they ought to be able to melt more easily into the general population and perhaps find a job.

That is the case with Claudia, who is travelling with her 17-year-old son. They left El Salvador, she said, because the local gang was threatening to kill him if he didn't join them. At first she had tried to deal with the situation by sending him to live with a relative in another barrio and telling the gang he had migrated. She decided that was not enough when she found out that they were suspicious of her story and her son began talking about suicide. Now she is seeking a way of getting to the port city of Veracruz, where she has heard there is someone who will offer migrants jobs in their hotel.

Claudia's situation is further complicated by a previous effort to leave El Salvador with both her children that ended with her in prison, accused of people trafficking because she refused to pay a bribe to a Salvadoran official. With the case still in the courts, she could face 10 years in prison for skipping the country if she is deported. "All I want to do is get there, get established and bring my other son up too," she said. "I just want to get my children somewhere safe. If they deport me after that and put me in prison, it won't be so bad."

The difficulties in moving north are also prompting ever more Central Americans to apply for asylum in Mexico, though their chances of obtaining it are slim.

Francisco, a Honduran from the Tenosique shelter, is doing just that. His troubles began last year, when the bus company he worked for refused to pay the protection money demanded by a major gang. That led to a massacre of seven bus drivers. Another seven were killed a month later. Francisco gave up his job and moved from his barrio, where the same gang had a presence. He took his family to a small rural town, where it has proved impossible for him to make enough money to feed them.

He couldn't move to a big town or city, he said, for fear of being spotted by one of the gang members looking for "traitors" who leave their territories and are considered dangerous because they could give information to rivals.

"I am in danger wherever I go in Honduras and the police will never do anything about it," he said, as he wove one of the bracelets he now sells to earn a little cash. "What can we do but leave if our authorities do absolutely nothing to help us?" he asked.