That's more a rough concept than a detailed idea but nevertheless a point to think about.

The "Deutsche Bahn" feeds already the overhead lines with energy produced by the braking of trains for their own consumption. Since each train is more driving than braking the produced wind could be caught and fed as energy.

Naturally it would have to be more adapted to aerodynamic than in my first example with the windwheels, otherwise the produced energy and the increased air displacement cancel each other out.
Perhaps the solution is no windwheel and no rotation but something with a quick movement like a fluttering flag in the wind.

Also trains could produce solar energy. At least they drive mostly at daylight.

By these optical and useful changes it would be visible also for passengers that the "Deutsche Bahn" strives for an ecological concept, without making greatly advertisement for it.  That's more sympathetic anyway...