Pretty much exist right now. The system is called PTC…. Positive Train Control. It has been in existence for quite some time, but railroads are slow to implement it in all areas and locomotives. Recent hi-profile passenger accidents have hastened it’s installation on all passenger routes, at least. The locomotive has in-cab signalling and limits the speed in restricted areas automatically if the engineer does not do so. It was being installed but not complete yet on the new line in Tacoma when the first train went off the bridge on the sharp curve up in your neck of the PNW.
We will still need engineers in the cab to watch out for obstructions like idiots trying to beat the train at a road crossing, though.