First hydrogen locomotive started working in Poland.
It’s kinda the default actually. Locomotives might lack pantographs if they never see electrified track but diesel locomotives aren’t direct drive but diesel-electric. I’m not that deep into the topic but from what I’ve heard a mechanical transmission would be a nightmare.
Modern trains are almost exclusively electric final drive, off the top of my head I can’t think of any exceptions. There are so many different voltages of overhead pantographs and drive motors though, there is almost always some type of converter needed to provide the right voltage to the drive motors.
A lot of locomotion uses DC motors, so they can run line voltage directly.