Technical schools will train you to be a diesel electric mechanic, just as they do for cars. Honestly, it's probably the best thing to go for right now because you have two domains that you can transfer that knowledge to if the railroads don't hire you - electric car motors and diesel truck engines.
Also, keep in mind that technical schools cost a lot less and take less time time. So you could get certified as diesel electric and if they don't take you, it should only require a few extra classes to get certified as a regular car or truck mechanic.