I doubt that fatal accidents can ever be completely eliminated from the railways, but the risks have however been reduced in recent years. Changes to working practices after Clapham junction have reduced the risks of wrong side signalling failures, but as the near miss at Waterloo showed, such risks have not been eliminated. (I doubt that the Waterloo incident could have resulted in fatalities due to the low speeds)
TPWS has greatly reduced the risks of driver error, but I doubt that such risks can be completely eliminated.
IMHO, the main risks these days are, in no particular order;
Careless or deliberate acts external to the railway, another Ufton Nervet could occur at any time. Whether due to suicide, or deliberately jumping the lights at level crossings.
Trees or man made objects foul of the line, Remember the HST that hit a tree at speed at Lavington ? Fortunately without serious consequence, but it could have been much worse. These risks may be increasing, as a budget conscious network rail cuts back on vegetation clearance, protest groups object to cutting down trees, and more people place trampolines and other bulky items in gardens near lines.
A new risk in my view is people being killed by heat stress or related conditions when trapped on board failed or stranded trains. With locked doors and sealed windows, and a less reliable railway, and a warming climate, this risk appears to be increasing. There have been a number of high profile strandings in recent years, and a number of reviews, but the policy still seems to be "keep them on the trains no matter what"
For reasons given elsewhere I don't much like the IETs, but the inclusion of a single diesel engine in the electric version is in my view an excellent idea.
Terrorist attacks on trains or infrastructure, not truly an accident, but could have similar consequences.
Despite these concerns, we must remember that UK railways are a very safe mode of transport. The most dangerous part of a rail trip is said to be the walk or drive to/from the station.
The loss of a handful of lives on the railway is called a disaster and is discussed and enquired into for years. A similar loss of life on the roads is called an accident and is forgotten about by the next day except by those directly affected.