The train already has an extra step where you have to confirm your selection.
After you click on a crate and choose from your Barn what you want to put inside, you also have to click the “Add to Crate” button to confirm your selection.
As soon as you click “Add to Crate”, the amount of coins shown above goes towards your Coins total and the items are taken from your Barn.
Undoing that (canceling the “Add to Crate”) could cause issues with quantities (in Barn produce and in Coins), and incidentally make the game reload.