Network Rail used a special train to remove dangerous 5ft (1.5m) icicles dangling from the roof of a tunnel on the Settle to Carlisle line.
The operator said some icicles were also cleared by hand by staff during the freezing weather conditions.
The icicles can fall and cause delays to passing trains.
Infrastructure director Chris Pye said: “Our extreme weather action teams prepare for when winter bites so we’re ready to keep the railway running.”
Network Rail also has special winter trains, with hot air blowers, steam jets, brushes and scrapers to clear snow and ice from the tracks.
Empty trains, known as ghost trains, often run overnight to keep the tracks clear.
Earlier this week, Northumbria Police also helped Highway Maintenance remove dangerous icicles from the southbound Central Motorway in Newcastle.