For example, Osaka is the main city of the Kansai Region, but the railway museum is located in Kyoto that is 45 kilometres away from Osaka.
This circumstance is applied similarly to York in the UK, Saitama and Otaru in Japan.
I conducted researches for all railway museums I mentioned above, but any reason what I wanted to knowledge was not found.
Japanese museums having been established at former yards or train depots were what I have found out.
For example, Kyoto Railway Museum is situated at Umekoji Steam Locomotive Rollingstock Depot. Otaru one was built at former Goods Train Depot as the 85th year anniversary of the Japanese Railway History.
Then let me making a point why rollingstock depots are built in suburbs. It's simple! Massive lands are essential to operate mechanical works and park trains.
Then when electricification is done, depots narrowed as less land is required to maintain rollingstocks, and the museums are built to promote the industry. Railway is unique and interesting so organisations could gain profits.
My favourite fleet on JR Osaka Loop Line