True, real train crashes are absolute carnage. But we're dealing with trains in a work of fiction here. This is what Thomas's page on this wiki has to say about his durability:
"Durability: At least
Wall level (Can casually survive smashing through walls with no damage), possibly
Small Building level (Has survived crashes from fellow steam Locomotives with similar Tech specs, comparable to Percy and Gordon who can survive going through multiple walls at once)"
With that much resistance to damage, plus his weight of around 98t (couldn't find the exact figure, so I used the weight of the Flying Scotsman, a similarly sized train), Thomas could easily generate enough force to cause serious damage to Goku.
Despite looking like a complete unit, Goku actually only weighed around 137lb at the end of DB. As a kid he'd have weighed around half that. There's been some debate as to if this is true, but it's what the official wiki says, so I trust it.
That little weight, combined with his speed over long distances (less than Thomas's) and superhuman durability would give him, let's say the force of a large speeding car to be fair.
Try ramming a car into a speeding 98t train and see what happens.
If the two ran at each other and collided, Goku would be thrown back onto the tracks, possibly unconscious.