A judge in Mexico has ordered the temporary suspension of works on a stretch of the Maya train project, citing a lack of environmental permits.
The project to build a railroad in the Yucatán Peninsula is President Andrés Manuel López Obrador's flagship infrastructure programme.
But cavers warn that it threatens caverns dating back millions of years.
The judge ordered works to be halted until studies could be carried out about the works' environmental impact.
Cavers had joined forces with environmentalists to bring the case to court last month.
They argued that a change in the route of the train line linking the tourist hotspots of Cancún and Tulum, known as Section 5, would harm the jungle it will now run through and the network of caves which lies beneath it.
Judge Adrián Novelo said building work on this 120km (75 mile)-stretch should be suspended because "a continuation of the works (...) implies the cutting down of trees, the destruction of flora and native species, and the perforation of the ground".
Environmentalists and speleologists had warned that construction work would damage the cave system which has been created over millions of years.
Aleira Lara, director of campaigns for Greenpeace Mexico, told the BBC that she welcomed the judge's decision and hoped it would result in a permanent suspension of construction work.
Ms Lara also praised the efforts of the cavers and their lawyers in getting their case heard in court.