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."

Council to review use of GP letters as evidence for disability claims
Plans have been put in place to redevelop a complex with more than 20 flats
Vale Council Reaccredited Under White Ribbon Scheme as Part of Ongoing Work to Tackle Violence Against Women and Girls
Two Vale Restaurants Among Those Set to Close as Whitbread Shuts Brewers Fayre and Beefeater Chains
Vale Council Issues Safety Warning After Gas Canisters Found in Household Recycling
Police Appeal for Witnesses After Early‑Morning Affray in Barry
Cogan Primary School Praised for its Inclusive Culture and Strong Leadership in Estyn Inspection
Senedd Members Call to Tackle Substance Use Stigma
Calls for Welsh Government to Match England's Pub Business Rates Cut
Caerdydd Penarth MS backs campaign to make rail station more accessible
Barry Waterfront Regeneration Project Moves a Step Closer
Age Cymru Responds to VAT cut to household electricity bills
Old Post Office in St Brides Major could be converted into a new house and set of flats
Kanishka Narayan retains AI Minister role as Burnham Signals Early Priorities
Victorian Building on Broad Street could become a new daycare centre
Barry to Host First-Ever Street Art Festival This August
Barry entrepreneur named finalist in major UK awards recognising top business leaders
New Barry watersports facility and housing
Man charged after Skomer Road assault