The train instantly gives you the coins for what you fill it with — not after it leaves.
When you select a product and click “Add to Crate”, you see the coins instantly going to your total.
What you see when you send the train is your Complete Shipment Bonus — it consists of XP, Coins, and Fuel (see lower left part of image below).
Therefore, in this example, you get the 72,400 coins for your 100 Peas instantly when you click on “Add to Crate” at the right.
You get your Complete Shipment Bonus of 562 XP, 4,774 Coins, and 2 Fuel at the lower-left if you completely fill all crates and send your train.