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 launch street cleaning service
Petition supporting Tree Preservation Order reaches 1,000 signatures
Le Tour comes to Cardiff
Trampoline park owner avoids jail
Housing rent increase rubberstamped
Half-hourly Vale trains delayed again
Tax premiums retained for empty homes
15,000 'missing' women at risk of breast cancer
Council facing £6.6m budget gap
Porthkerry: grazing sheep attacked by dog
20 or 30? Council to consider speed limit changes
Money raised for family after house fire
Gwen the polar bear visits the Memo
Council tax set for 5.5% rise
Barry Town Council's precept could increase by £5.41 from April
More than 40 organisations set to showcase their volunteering opportunities in 2026
Yellow Weather warning issues for Snow later this week