Trains are transportation infrastructure. Drivers don't have to put up with people setting up a queen bed in the middle of their lane on the highway. If a country doesn't protect its public transport infrastructure, then the rich and the middle class stop taking the train, the poor have to put up with things, and the mentally ill get an overpriced and noisy mobile homeless shelter. One that costs more and helps less than crisis accommodation.
I agree that the two aren't exactly the same, but public transport users have a right to safe, comfortable, unobstructed travel. There's a difference between preventing a class of people from using public transport to travel, vs preventing everyone from using public transport to sleep.
I also note that the case of long distance travel is an exception, because you might legitimately need to sleep at a station between legs. I'm talking about people who sleep in train stations with no intent of travelling anywhere.
At this point, I'm beginning to think you consider the mere presence of a rough-sleeper at a train station to be blocking the use of that train station, regardless of what it is they're actually doing.