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

25 arrested in second day-of-action
South Wales Police precept set to rise
Drug dealer jailed after high-speed chase
April rollout for soft plastics recycling
More support for people affected by ketamine
Two men charged with tool theft
Councillors back Old Harbour reserve calls
Missing person rescued near Rhoose Point
More support for farmers to join subsidy scheme
New exhibition marks Holocaust Memorial Day
Blood pressure monitors available from libraries
Man charged with Cardiff Bay sex attack
Miss Marple classic comes to Dinas Powys
Candidates confirmed for by-elections
Drug dealing gang jailed for 45 years
Council drops school budget warnings
Burger stand owner fined for hygiene breaches
Deputy First Minister pledges cleaner rivers