Locomotives or motor railcars with IC engines or gas turbines