I lived and worked in Japan for 8 years back in the 1980s/1990s, managed to learn the language, married a local girl and have been visiting for business /see family once or twice a year. (not recently though -COVID - sadly) ever since.
It really is a fascinating place: my second home.
There is an endless amount of items of railway interest in the country and I am fortunate to have experienced a lot of journeys there over the years, I have met many wonderful people and am lucky enough to read railway journals and timetables in Japanese. (there are some old maps and schedules on the "timetable world" website )
As mentioned above, Tokyo is fascinating with its mix of suburban railways. Not just the "narrow" gauge and standard gauge but also the in-between "scotch" gauge (google it !) used originally by the Tokyo tram system (almost defunct) and now the Keio line commuter railway.
Also fascinating is the fact that back when electricity was first introduced into the country, two separate systems were used. Domestically it was all on the 110v AC /120v AC but the frequency was different: Western Japan uses 60 Hz and Eastern Japan uses 50 Hz. This means that on the Shinkansen the 25kv electrification also uses two systems - the original (west from Tokyo) Tokaido-Sanyo line is at 60 Hz whereas the bullet train lines going north from Tokyo use 50 HZ. They meet at Tokyo station.
Don't miss the excellent Railway Museum in Kyoto if you go. Some pictures of it on my little blog here
https://trainstobeyond.com/2017/08/26/2017-japan-kyoto-trains/ - NB - The blog is more my general travel experiences than strictly "rail enthusiasm", but there is more about Japan in the "Japan category"
There is also an excellent railway museum in Omiya just outside Tokyo too, almost as good.
Comparisons with the UK?
I think the way they privatised the railway in Japan (1987) was a lot better than the way it was done in the UK. Track and trains stayed together. Divided into 6 or 7 based on geography with a shared JR identity and then the profitable private companies sold off with the others staying government run. A common R&D facility was retained.
I like the way that all the express / shinkansen trains are divided by reserved and non-reserved seating coaches. It makes finding a seat without a reservation far easier than having to trawl through a carriage full of reservation labels.
Japan abolished 1st class back in the mid 60s and replaced it with a section-by-section "Green Car" system. The basic tariff is "standard" class and distance based. All or part of of any journey can then be upgraded to Green Car based on whether there is a Green car on the train. A point to point first class ticket in the UK is often wasted if part of it involves trains that only have standard accommodation. Green cars are on most Shinkansen and Express trains but also on some of the commuter trains in the big cities. Regular ticket holders can upgrade to Green by buying tickets at platform machines or by contactless card touching a point over the seat.
The lack of a common ticketing system mentioned by
busesrusuk above is certainly a problem, especially for traditional paper tickets. Tokyo has nothing like the Tfl travelcard and that is a shame. However many of the railway companies issue their own brand of smart card (for JR East there is Suica, for the Tokyo subway there is Pasmo) and all of them are interchangeable around the country. So it is possible to use your Suica card on the Monorail to Haneda airport, fly to Fukuoka and use the same card on the Fukuoka subway - even though the locals are using their own brand of smart card.
I also like their approach to express train naming - they usually decide on one name for a train between two points and then use a numbering system to denote the exact train. So for example, every (narrow guage) express train that links Fukuoka and Nagasaki is the Kamome (Seagull). They start in the morning with the down train - Kamome 1, then Kamome 3, 5, 7 etc.. the up trains are 2,4,6. It is easy to understand and the general public buy into it. I think that could work in the UK too - every Paddington to Penzance train called the "Cornish Riviera Express" 1,3,5 etc every Bristol service - "the Bristolian".
I think the railway itself is more integrated into people's lives in Japan - more part of the culture than in the UK . Obviously a higher percentage of people are travelling on the trains but generally there is more knowledge / interest in the types of trains and the names of the services from the general public. There is even a whole series of TV detective /murder dramas where trains feature and the hero detective always solves the crime by working out details like that the fact that murderer managed to change from one train to another at a certain point because one train was running late. There was another drama series about the girls who work on the Shinkansen.
Much as the Shinkansen is wonderful, I love the local trains in Japan. All the long secondary lines that criss cross the countryside. Get on one of those for a long trip - fantastic people-watching opportunities.
Can't wait to get back there and would reccommend to anyone -
Go, if you can, generally it can be cheaper than you think too.