Complex sentence: The whole line had been extremely costly to build, with many tunnels and earthworks and, with its bends and gradients, proved a challenge to footplate crews.
Split into simpler sentences: The whole line had been extremely costly to build, with many tunnels and earthworks. With its bends and gradients, it proved a challenge to footplate crews.