Hello,
I'm not sure how to do it.
As far as I know, trains (and cars, tanks, demolishers) do "impact" type damage. Also, train has collision box, so that means mech armor automatically jumps over it like any other entity. So to my knowledge, it would not be easy without changing all train type entities (but i'm still not sure).
If someone knows a better way, please let me know I'll try to add it to the mod.
Thanks.