Links are to British resources, since I only read English, and the UK has the safest railways in the world.
* Upgrading signalling systems at technology progresses.
The latest systems use in-cab signalling, so the driver can't fail to see a signal due to fog etc, and the train's computer is aware if a signal is missed and will stop the train. (These systems are decades old, but I've read that they're not common in the USA. It took a couple of major accidents in the UK for them to be installed.) [Search ETRMS rail, or in-cab signalling].
GSM-R, i.e. the railway version of the original European mobile phone system, provides a big red button. If pressed, all trains in the area are immediately stopped. A driver would press this if the train is expected to crash, or has crashed. That can stop an oncoming train on the opposite track. [Search GSM-R]
* Maintaining the track to a high standard
Running a measurement train [1] over the whole rail network regularly, which accurately measures "the track geometry and other features such as overhead line height and stagger, and the track gauge, twist and cant". Changes in this can show where maintenance is needed much earlier than a visual inspection, and the data can be inspected retrospectively if there is a problem.
Machine learning is probably the newest/next step for this [2].
* Thoroughly investigating any accident or "near miss"
An independent group [3] investigates accidents, with the aim of preventing future accidents rather than assigning blame. The most recent report [3A], for example, finds problems with project management and recommends, "Network Rail should review its project assurance process as applied
to the CASR scheme". The depth of these investigations is comparable to most western countries' investigations of aircraft accidents.
Investigations like this are what leads to posters in stations saying "don't run down the stairs" or "mind the gap" announcements. Falling down escalators or under a train in a platform is much more likely than being involved in a crash while a passenger on a train.
[1] https://en.wikipedia.org/wiki/New_Measurement_Train
[2] http://www.vision-systems.com/articles/print/volume-20/issue...
[3] https://www.gov.uk/raib-reports
[3A] https://www.gov.uk/raib-reports/serious-irregularity-at-card...