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