You shouldn't be able to buy any railway related keys that could breach security measures, nor should any non railway employee be in possession of any railway keys.
In the case of T-keys, they're not a railway exclusive locking device. I have a couple in my toolbox (bought legitimately) used regularly for accessing things like ceiling hatches and maintenance cupboards in buildings as part of my work. The design of the locks involved means even if they were originally designed for exclusive railway use (and I doubt that is the case), they'd be copied and used elsewhere. I doubt it's possible to design a simpler or cheaper, but equally robust, mechanism, hence their popularity.