https://kaisercougarconnection.com/2784/news/musical-trains-...
My impression is that all of the Yamanote line stations are above ground -- I'd have expected it to be possible to have "one button plays the right sound at each station" if you used a standard phone's GPS to figure out which station you were at.
Kids these days...
Not only you don't need a GNSS to determine a fixed in place railroad station but actually you don't want to use a GNSS to do that.
A simple radio beacon working on ~400MHz is more than enough to solve this difficult technical obstacle.
Of course, this is totally ignoring what the trains do already know where they are because they need to display the current/next stations on the passenger information displays.
At a minimum that's acceptable enough even by modern-ish safety standards, the signalling system only needs to know which sections of track are occupied and which are free, and it only needs to know that at the granularity of individual block sections between subsequent signals. It also doesn't necessarily need to know about the identity of the train, even though in practice you'll want to track that, too, for the convenience of the signallers.
The train in turn doesn't need to know where exactly it is – in terms of safety, it's enough knowing the local speed limit and the state of any upcoming signals, but for that, it doesn't need to know where it is in relation to the outside world. The classic implementation is simply fixed trackside infrastructure telling the onboard safety systems all they need to know.
Historically, any demands for knowing where the train is exactly in relation to the outside world were rather driven by automated passenger information systems and the like rather than the safety-critical parts of the signalling system.