The problem isn't as bad as you might think. For another, there's hot and cold running water in the toilets that, with a little care, allow for a sponge bath. About the toilets, as time between daily cleanings increase, they become remarkably less pleasant. Just think about all the motion involved and you can get an idea of the problem. Apart from the toilets, no one should have any cleanliness complaints.
Attendants clean the car regularly.
There are two classes of travel on the long distance trains. The only difference is that first class has two people to a compartment, second, four. Second class provides more opportunity for interaction with other travelers. It's hard to be in a compartment for a couple of days without some type of communication taking place. Security Common sense is your best protection.