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.
There are both ‘series hybrid’ automobiles, and ‘parallel hybrid’ automobiles. The ‘series hybrid’ vehicles have the electric and IC motors in series (on the same shaft), but the ‘parallel hybrid’ vehicles do not. Locomotives, as you said, do not, and are also not a hybrid, as they have no propulsion batteries.