It also depends on the carriage type, whether it is a 1st class only or a mixed 1st/2nd configuration. With the former case (1st only), standing anywhere in the carriage is a taboo zone for 2nd class ticket holders (while walking through the carriage e.g. after a stop is ok).
Such rules were in place over a century ago. Nevertheless, our ancestors somehow were able to deal with them, even without mass media and Internet.