The burglary was caught on CCTV around 04:00am on the 9 December 2009.
Trevor Davies, 20, and David Cooper, 24, were killed minutes after the robbery when a train hit the quad they were riding on.
They had been using the railway line as a get-away route on the vehicles after stealing over £40,000 worth of “Gore-Tex-branded” jackets.
Anthony Thomas, 23, and Liam Xuereb, 22, who were travelling on a second vehicle, survived the accident.
Prosecutor Stephen Jones said: “It was four best friends committing a burglary which resulted in tragedy.”
The pair, both from Cardiff – also admitted endangering safety on the railway.
They will be sentenced next month