Sampuran Singh has been fighting for the money since 2015, when he went to court to argue that Indian Railways had underpaid him for a piece of land in the northern state of Punjab, acquired to build new tracks.
He won his case, but the railway refused to pay and he filed another plea in January.
On Friday, Singh's lawyer said a court in the state had awarded him an express train in lieu of the 10 million rupees he was owed.
"We were tired of pleading with the railways to clear the pending dues. The court asked us to identify properties for recovering our money," Rakesh Gandhi told AFP.
Judge Jaspal Verma also granted Singh ownership of the station master's office in Ludhiana, a city in Punjab that the train passes through.
After the hearing on Wednesday Singh and his lawyer took the court order to Ludhiana station where they waited for the train to arrive before handing the document to the driver.
Singh said he allowed the driver to carry on to its destination as stopping it "would have caused inconvenience to thousands of passengers".
"If they fail to pay the money by Saturday then the court can sanction an auction," Gandhi said of the 20-coach express train, which runs daily between New Delhi and the Sikh holy city of Amritsar in Punjab.
Several Indian courts in the past have unsuccessfully awarded trains to aggrieved farmers over unpaid dues.
Last year, an express train was confiscated on court orders after a 62-year-farmer in southern Karnataka state won a compensation case over land taken in 2006.
The intercity express was halted at Harihar station for two hours before officials convinced him to release it.
And in 2015, railway officials handed over 3 million rupees to two farmers at a station in the northern state of Himachal Pradesh to secure the release of an express train.