It costs money but in the grand scheme of things it doesn’t cost much. It could easily be added in software, the train already knows where it is.
There's actually a good chance that the train doesn't "know" where it is. The standard of the passenger information screens "knowing" where the train is may be mich lower than needed for a safety critical system.
I've been on even modern trains (class 700) where the PIS was announcing the station 1 mile behind where the train actually was (so announced Farringdon on the approach to City Thameslink, and Blackfriars on the approach to London Bridge).
That kind of issue is poor from a customer service perspective, but has little consequence for the safety of the train. Now if you were to tie that into door enable logic, you end up with a system which, regularly enough, needs to be overridden by the driver, if there's been a GPS issue, some sort of train setup issue, or the train was unexpectedly diverted. That will mean that drivers will "get into the habit" of regularly overriding it, and then we're left in basically the same situation we have now.
Railways that are serious about this have beacons at the stopping point on the platform that ensure that:
a. The train is in the right stopping place for the platform length, and
b. the doors should only open on this side, right here, at this platform.
You can see this on London Underground, I believe that the >>>>S7<<<< markers on the subsurface lines show the drivers exactly where to stop so that the correct-side-door-enable beacon lines up with the receiver on the train.
Any GPS or distance travelled based system, which would be OK for PIS systems is unlikely to really meet the standard that's needed, unless it can be augmented by some sort of additional information provided to prove that the system is right.
In addition, such a system would need to differentiate between the two platforms at St James and Airport, and to be able to handle alternative operation (such as turning back at Heworth from the "wrong" platform)