Totally different application/need though. Locomotives need to generate enormous amounts of force, for long periods of time, regardless of speed. Often at zero speed.
That capability is much more important than the efficiency loss of the generator/motor powertrain.
Such capability is not necessary on a bicycle, where efficiency is extremely important.
Bikes handle much differently from diesel trains. This may work for some but I can see it occupying some kind of uncanny valley in the riders' psyche for a while.
You ever ride in one of those bar on wheels things you find in touristy places?
It's got "barstools" along both sides and the passengers/revelers are supposed to turn the pedals under their seats while the bartender/driver steers.
In reality, the pedaling charges the battery somewhat but the vast majority of the battery power comes from being plugged in at a charger before the ride. You can't actually rely on a bunch of drunk sods to keep it moving.