Energy recovery technologies concerning the propulsion system in locomotives or motor railcars