Complex sentence: Both were ex-London and Greenwich Railway steam locomotives; that fitted to "Erebus" having formerly been № 4 "Twells".
Split into simpler sentences: Both were ex-London and Greenwich Railway steam locomotives. That fitted to "Erebus" having formerly been № 4 "Twells".