The idea that medieval peasants somehow had more free time than the average modern american still is absolute bullshit as far as I’m aware. Unless “necessary preparations for survival” count as free time just because it’s not contracted work (it doesn’t that’s not what free time means).
Those will always be a small part. If it’s culturally clear what is harrassment and shouldn’t be tolerated, it’s far more likely that 1) there are actual consequences to sexual harrassment because victims feel comfortable speaking up and 2) that bystanders will try to intervene. Both of which make it less likely for anyone to even try.
When speaking up is met with “you dressed wrong”, “he was just trying to get to know you”, that is the core problem. Adding “you were on the wrong train car” isn’t necessarily helpful.
Japans women-only cars are sadly necessary, but the focus should be on making them unnecessary, not adding gender segregation in more places.