Network Rail says millions have been spent preparing for the increasingly wet weather, but that costs will increase if climate change continues.