The two had challenged in the sessions court a railway court order framing charges against them.
Additional District Judge Pawan Kumar granted relief to Deol and Kapoor on Friday, A K Jain, the counsel for the two actors, said Saturday.
The actors were accused of illegally pulling the chain of train 2413-A Uplink Express, which led to its delay by 25 minutes.
The counsel said the charges were initially read out against both the actors in 2009, which they challenged in a sessions court in April 2010.
The session court exonerated both the actors, but on September 17, the railway court again framed charges against the two following which the actors pleaded in the district and sessions court, Jain said.
Besides Deol and Kapoor, stuntman Tinu Verma and Satish Shah were also accused in the case but they had not challenged the charges against them in the sessions court in 2010.
In 1997, Deol and Kapoor, along with other crew members, were shooting for film ‘Bajrang’ at Sanvarda village near Phulera in Ajmer district.