Complex sentence: It was built in 1857 by Wilts, Somerset and Weymouth Railways, an independent company, though they were heavily backed by Great Western Railways, this required a tunnel to be dug directly underneath Devizes Castle.
Split into simpler sentences: It was built in 1857 by Wilts, Somerset and Weymouth Railways, an independent company, though they were heavily backed by Great Western Railways. Its route required a tunnel to be dug directly underneath Devizes Castle.