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

Local residents in Cowbridge have banded together to buy a beloved piece of land
Welsh legend Max Boyce and record-breaking footballer Jess Fishlock honoured at St David Awards
New care home could be coming to Barry is council approves plans
50+ Forum Radio Show highlight by World Health Organisation as leading age-friendly initiative
“Long-established rural enterprise hub” has applied for retrospective use of a base to provide services to the “wider rural community”.
Vale Council named Employer of the year for Apprenticeships
Vale Council has the 4th highest rate of complaints of any local authority in Wales
Average Vale House Price rises to £300,000
Penarth Library shortlisted for Library of the Year Award
Keep Wales Tidy launch "Drive your litter home" campaign
Members return to the Senedd Siambr following redevelopment
Barry resident shares his story of Operation Pied Piper in new book
Council to engage with public over future of former Wilko Superstore in Barry
Former Conservative turn Reform candidate wins Penarth By-election
Two teenagers sentenced for murder of Kamran Aman in Barry
Council celebrates success of Solar Scheme with Relaunch
Vale Food Trail set to return for 2026
Centenary Year Begins as Barry Swimming Club Celebrates 100th AGM