Early morning train services were disrupted following an incident near Barry Docks.
British Transport Police said one man was taken to safety after they were spotted "in a precarious position" early on Monday morning.
The Vale of Glamorgan Line was blocked between Eastbrook and Barry, affecting services to and from Cardiff Central.
It also affected lines between Rhymney / Bargoed / Caerphilly and Barry Island, as well as from Rhymney and Cardiff Central to Bridgend.
Transport for Wales later confirmed the line had reopened, but they warned services were still subject to delays, cancellations and alteration following the incident.
A BTP spokesperson said: "Officers were called to the line near Barry Docks just after 5am today (11 November) to reports of a person in a precarious position. Officers attended alongside paramedics. A man has now been taken to a place of safety."

Vale Council Highway Authority raises concerns about St Athan housing development
Over £500,000 awarded to continue Restore the Thaw Project
Barry Library shares the joy of reading with World Book Night Giveaway
Barry Town's Robbie Willmott retires from football to take on new role
Volunteers in Scouts across Wales recognised for outstanding service at Windsor Castle
Calon Hearts uses Heart Failure Awareness Week to spotlight early detection and prevention
Local candidates face nature & environment Question Time
Final spaces available for free heart screenings in Cardiff this weekend
A century-and-a-half old Pub in Penarth could become a set of new flats
Caedydd Penarth constituency Profile
One-week Town Boost in Llantwit Major hailed a success
Vale Reform Councillor defects to Restore Britain
Man charged follow incident at Park Road on Monday
Barry Photographer returns for homecoming exhibition
Marie Curie team to tackle 40 hour Bikeathon
A bid to transform one of Cardiff’s most well-known independent music venues has been approved
The Senedd Election 2026: What’s changing? Why? And how does it affect you?