Locomotives have no propulsion batteries. EVs and hybrids rely on batteries to store power.
EV’s and Hybrids also have the ICE and electric motor on the same crankshaft. I do not believe that Diesel Locomotives and submarines (which do have batteries for obvious reasons) have independent shafts, the electric motor turns mechanically independent of the ICE.