Complex sentence: The engineer had gotten out of the originally slow-moving train to correctly line a switch as part of moving a string of freight cars from one track to another within the train yard.
Split into simpler sentences: The engineer had gotten off the locomotive of the originally slow-moving train in order to correctly line a track switch. This occurred while he was using the locomotive to move a string of freight cars from one track to another within the train yard.