Two Malaysian women who tried to smuggle $1.34 million out of Western Australia were nabbed after flaunting the cash in front of a train official, then trying to tell police they earned it from prostitution and gambling.

Yoke Peng Oon, 35, and Han Yueh Hew, 35, travelled from Sydney to Perth to collect the money with the intention of returning to Sydney and delivering it to another person in June last year.

But when they tried to purchase their tickets to Sydney, the credit card failed to work and the bag of cash was opened in full view of a train official, the WA District Court heard on Thursday.

"The train official was surprised at the cash they saw (and) contacted the police," Judge Michael Bowden said.

The women travelled by train to Kalgoorlie where they were arrested.