Tomasz Tyszka, 31, of Raby Road, Wheatley, was jailed for 12 months after pleading guilty to possession of drugs with intent to supply.
He was arrested when he realised he had left his case on the train at Leeds station and returned to collect it.
Leeds Crown Court was told that at around 2.15am on September 19, 2014, staff cleaning the train which had arrived from London discovered a large silver suitcase in a luggage rack.
When they checked inside to see if they could determine the case’s owner, they discovered two vacuum sealed packages and noticed an overwhelmingly strong smell of cannabis.
Officers from British Transport Police were called and as they attended Tyszka returned to collect his case, which he had mistakenly left on the train.
He was subsequently arrested and searched where he was found to be in possession of two large bundles of over £5,000 in cash.
The case was seized and further examination determined that the two packages were cannabis with a street value of over £5,000.
Tyszka was charged with possession with intent to supply.
Speaking after the sentencing, Detective Constable Tom Eastwood said: “Drugs wreck lives, so it is pleasing to see a dealer behind bars.
“Tyszka has learnt the hard way that carrying or dealing drugs on the transport network is not acceptable.
“BTP carries out regular operations, including the use of detection dogs, to catch those carrying illegal substances on trains and in stations.
“Drugs will not be tolerated anywhere on the rail network and officers will do everything in their power to bring prosecutions against those concerned with the supply of drugs.”