The aftermath of the 2007 derailment at Grayrigg in Cumbria. Photograph: Getty Images

Network Rail has been fined £4m for health and safety failings leading to the 2007 Grayrigg train crash that killed one passenger and injured 86.

Mrs Justice Swift imposed the fine on the rail infrastructure company at Preston crown court. Network Rail pleaded guilty last month to breaching health and safety law ahead of the derailment of the Virgin train in Cumbria, in which an 84-year-old woman died and 28 people were seriously injured.

The service from London Euston had 109 people on board and was travelling at 95mph on the west coast mainline near Grayrigg on 23 February 2007 when it derailed, throwing all eight carriages down an embankment.

The Office of Rail Regulation took the decision to prosecute after a coroner's inquest last year found that badly maintained points made the Pendolino train come off the tracks, killing Margaret Masson, who was travelling home to Glasgow with her daughter Margaret Langley. In a statement to the court, Langley's daughter described how her mother was still in constant pain and receiving medication five years on.

Ian Prosser, the director of railway safety at the regulator, said: "The derailment near Grayrigg was a devastating and preventable incident which has had long-term consequences for all involved. It tragically caused the death of Mrs Masson, and shattered the lives of others. My thoughts are with Mrs Masson's family and all those injured and affected by this horrific incident.

"Network Rail is focused on driving safety measures and I welcome the company's progress on implementing safety recommendations made after this incident. But the pace of carrying out improvements has, at times, been too slow and the rail regulator has had to repeatedly push the company to bring about change."

Grayrigg is the last of three recent high-profile prosecutions and fines for Network Rail over incidents dating back a decade. Last month the company was fined £1m over the deaths in 2005 of two schoolgirls on a level crossing at Elsenham station in Essex. Last year it was fined £3m for the faulty points that caused the 2002 Potters Bar crash, which killed seven people.

Sir David Higgins, the chief executive of Network Rail, said: "The Grayrigg derailment in 2007 resulting in the tragic death of Mrs Masson was a terrible event. Within hours it was clear that the infrastructure was at fault and we accepted responsibility, so it is right that we have been fined. Nothing we can say or do will lessen the pain felt by Mrs Masson's family but we will make the railways safer and strive to prevent such an accident ever happening again.

"We have learnt from the accident, determined to recognise what we got wrong and put it right. An event like this affects everyone in the company, and especially those with responsibility for the track. Since the accident, much has changed in the way we plan and carry out maintenance work with new systems put in place to improve the quality and safety of our railway which is why we now have one of the safest passenger railways in Europe."

The coroner's inquest last year was told how the track supervisor had failed to carry out proper checks. He blamed understaffing and said he was under enormous pressure, and in an email to his managers had warned of a "shambles".

The RMT union, which held a demonstration outside court, criticised the role of the ORR in bringing the prosecution, saying it was "wholly incompatible to have a safety regulator which will be enforcing cuts". Unions fear the fine will only lead to more cuts to Network Rail's budget, and say the regulator is trying to push through cost cuts in the industry as recommended by the McNulty rail review.

An RMT spokesman said: "If the McNulty rail review is allowed to let rip you can expect more Grayriggs – the same poisionous cocktail of conditions that led to crashes in the first place. The ORR tells Network Rail they need to make cuts and then bring them into court when they deliver them."