Hundreds of miles of railway lines around Britain’s coast are becoming increasingly vulnerable to waves, landslides and storms triggered by climate pollution, an expert has warned.