The thing about T-keys (possibly excluding the ones with pins in the middle of the lock) is that they're by no means exclusive to the railways. I know of more than one instance away from the public transport sector where people have been looking for a lock to deter casual access to an area, and have settled upon budget locks with T-keys as the ideal solution.
The reason T-keys and master keys are so prevalent is because with a large number of people with a legitimate need to access a large number of panels, distributing individual keys for each vehicle to all staff would be impossible. How should it be solved? Well, I guess electric locking of the panels is one way forward, which would allow lost keys to be removed from the system - but they don't call the T-key locks "budget locks" for no reason, and implementing an electronic system wouldn't be without some considerable costs. Not to mention that you've got the possibility of a guard getting onto a train and finding out that it doesn't recognise their new electronic keyfob/card, and that they can't open the doors!