More than £8m in funding has been secured to improve freight and passenger services on the Cumbrian Coastal Railway Line.