Thieves caused delays for South Wales Main Line rail passengers throughout the weekend and into Monday morning.
Police are investigating the theft of 165ft (50m) of railway signal cable which was cut from the track between Cardiff and Newport on Saturday.
While replacing this, engineers accidentally disturbed a nearby cable - which had been replaced after a separate theft - cutting the power.
The power was out from 20:45 BST on Sunday until 03:00 on Monday.
Some trains were cancelled on Saturday and many more affected after thieves cut the cable at about 15:15.
Officers said the theft "caused huge disruption and inconvenience to passengers".
"An extensive search of the affected area was carried out by officers on the ground, alongside railway engineers," a British Transport Police spokesman said.
"It was discovered that a section of signalling cable, totalling 50 metres, had been cut and stolen."
Trains had to terminate at Newport and buses replaced services to Cardiff and Swansea while routes between south Wales and London, Gloucester, Manchester and Holyhead were also affected.
Some trains were delayed by up to 70 minutes while others were terminated early.
Limited services were allowed along the line by about 18:45 on Saturday before the loss of power on Sunday.
Arriva Trains Wales director Lynne Milligan said: "This was a very challenging situation and we did all we could to minimise this disruption safely.
"Understandably all those customers affected will have been very frustrated and we would like to thank them for their patience."
Separately, on Monday night, a signalling system fault caused major disruption to trains between Cardiff and Newport.
Replacement bus services are in place, but delays and cancellations to trains are expected to last for the rest of the evening.