A Bexar County official reported that “39 men and 12 women” died in the sweltering heat of the abandoned trailer after it was discovered on a road in her district. It was the deadliest single incident involving migrants along the southern border in memory.
President Joe Biden blamed “criminal” professional drug smugglers for the tragedy.
“This incident underscores the need to go after the multibillion-dollar criminal smuggling industry preying on migrants and leading to far too many innocent deaths,” he said in a statement on Monday.
Federal law enforcement agents on Tuesday arrested two men at an address linked to the trailer's registration, court documents showed.
Juan Francisco D'Luna-Bilbao and Juan Claudio D'Luna-Mendez, both Mexican nationals whose US tourist visas had expired, were illegally in possession of firearms, the documents alleged.
A third person, suspected of being the driver of the lorry and trailer, was arrested nearby while “very high on meth,” said the local daily San Antonio Express-News, quoting a law enforcement officer.
Twenty-seven of those who died are believed to be of Mexican descent, said Rubén Minutti, the Mexico consul general in San Antonio.
He said some of the survivors were in critical condition with brain damage, internal bleeding and other injuries.
Mexican President Manuel Lopez Obrador called it a “tremendous misfortune”.
Guatemala's Foreign Ministry said on Tuesday that it had confirmed two of the people in hospital were Guatemalan.
Many of the dead were found without identification documents, complicating the process of identifying them. One had a stolen ID.
Dozens of people held a vigil for the victims on Tuesday night, expressing anger at the dangerous trek that many migrants make each year in search for a life in the US.
“If we had a better way of allowing people to venture safely — and I need to change that — if we had a better way for brown and black people to enter safely, they wouldn’t go through these desperate measures,” said Debbie Ponce, who attended the vigil.
Organiser Carolina Canizales said that for many at the vigil the tragedy was deeply personal.
“Migrants matter. And their lives matter,” she said.
Texas Governor Gregg Abbott blamed the incident on Mr Biden.
“These deaths are on Biden. They are a result of his deadly open border policies,” Mr Abbott said.
Mr Biden said an anti-smuggling campaign he had launched had so far arrested 2,400 people in recent months.
“Exploiting vulnerable individuals for profit is shameful, as is political grandstanding around tragedy,” he said.
The Associated Press contributed to this report