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

£20 million regeneration Plan submitted to the UK Government
Popular Barry Island Chippy announces its closure
Missing Penarth man found after appeal
Parc prison expansion plan ''ill-judged''
Panto stars drop in at Penarth hospice
Ruth and Steve go training with the RNLI
Aberthaw: trespassing banned at power station
New trains coming to Vale line in 2026
Council approves next step in Crossrail scheme
Aberthaw turbine donated to aviation museum
Council publishes 2025 self-assessment
Calls to ‘eliminate’ small business rates rejected
Lifeboat crew commended after complex rescue
Cladding repairs 'nowhere near acceptable pace'
More council cash in budget deal
Council boss joins CCR Energy
Senedd backs bus shake-up
Labour and Plaid strike £300m budget deal