I am planning a trip with the Transsiberian railway in September. I read that they heat the train compartments very well. Since I am more the low temperature loving guy, I'd like to wear shorts when the temperature is rather high (+20°C) and don't want to carry too much clothes on the trip. Is it okay to wear shorts in the train (my favorite one is light green and very noticeable)? I am not vain but may be this is somehow inappropriate. Or will I just be the дурак (idiot) then like my father was 20 years ago on Ibiza with his knee high socks, sandals his "I am the Boss" basecap?
That's absolutely OK. Moreover, Russians' concept of appropriate clothing in trains is very very very relaxed; many people will wear clothing that they will never wear in many other public places (such as old worn shirt or tracksuit-like trousers, etc.) Of course, this depends on the class, in the platzkart (3rd class) passengers have most relaxed clothing, while the passengers of the expensive classes tend to wear more formal clothing, although even they will often change to something relaxed when in train. I can only suggest you not wearing too 'toxic'-colored clothing (or 'neon'-colored, very bright and flashy); but the one on photo seems ok for me.
However, not every train and not every carriage will be heated too much, especially in September. This depends on train type, carriage type and conductor, so I will not rely on having only shorts with me. The weather in September can also be unpredictable. Also, newer carriages have air conditioning, so they do not become hot. Check the AC availability when booking (though this may be non-obvious).
I did a tour on the Transsiberian last year in early September. I was in shorts for most of the time (including the long station breaks). Nobody gave a damn. (I should add that it was entirely in Russia, no streches in Mongolia or China; it may be different there.)
On the other hand, visiting Jordan I was stared at a lot for being a guy, having long hair and wearing shorts, even though nobody said anything (I just clearly stood out as a tourist). So going by this difference, there should be no problem at all in Russia.
I’ll also echo what Petr has said about the dress code on train being much more relaxed than that outside of the train.