Much more of a problem for women being touched (we are talking in a bad way, not just rubbing shoulders here) by dirty old men. It is really sad that even with all the public campaigns to eliminate the problem, enough people still were getting away with it that they needed to introduce women-only cars.
My friend was on a train a few weeks ago. It was a very crowded Tokyo commuter express (they get very tightly
packed). When she got off, she felt a little strange. The man who she was pressed up against had completely undone her jeans.
Please don't assume this is common though. This type of thing is pretty rare.
if you are a woman in Japan and worried about getting felt up by dirty men in trains the easiest way to stop it is to yell out. I get a bit frustrated when some girls complain, but they did nothing when it happened.
Tell them loudly to get lost and it will stop immediately. Unfortunately a lot of Japanese girls are too shy to do this and so the problem continues....
Those pervs are called "chikan" but some measures have been taken against them. There are special women-only parts of the train, especially during rush hour, there are special police men without uniform in the station and on the trains and there's a campaign telling 'chikan' they are wrong. Don't ask me what the purpose of such a campaign is (ちかんあかん！) but it's propably a way to make it more open and therefore easier for victims to resist, which indeed didn't always happen in the past.