yes some train lines are unprofitable but they are also vital transport infrastructure
I'm currently working in the Middle East and the growth of this place is fast; I saw black and white photos of buildings built relatively far out of the city where there was nothing around for (miles? I'm not good at gauging distances), but you know what? Decades later the city's expanded until those same places have now been enveloped by the rest of the city. I can't speak to the train situation in some areas of China, but it may very well be a similar situation where in several decades time it'll be extremely important that they're there.
I'm currently working in the Middle East and the growth of this place is fast; I saw black and white photos of buildings built relatively far out of the city where there was nothing around for (miles? I'm not good at gauging distances), but you know what? Decades later the city's expanded until those same places have now been enveloped by the rest of the city. I can't speak to the train situation in some areas of China, but it may very well be a similar situation where in several decades time it'll be extremely important that they're there.