I've commuted on and off for a long time and had two nasty experiences at the hands of train creeps when I was much younger.
Both times, I froze and was meek and never reported it.
So my advice would be:
Travel! - get out there and stride - and be alert and aware.
Don't assume rush hour is safer - gropers and thieves love crowds.
Keep alert on the station before you get on, and if there's someone behaving oddly, use a different entrance or wait for the next train.
Sit on an aisle seat so you can't be squished against the window and can move elsewhere.
Don't settle and spread - stay mobile, keep your stuff easy to scoop and shift.
Keep phone & purse in your bag not on the table and keep your bag on you - a cross body bag is harder to nick.
Don't fall asleep or get completely lost in a book or podcast - keep alert.
Use a single ear pod rather than headphones so you can hear if something's happening.
Look and listen about you, so you can notice odd behaviour and switch to another carriage or get off.
Know how to call for help on the train or platform.
Some will go on about victim blaming, it shouldn't be on us to stay safe etc etc. But just as we lock our home, car, bike etc, we can increase our own security.
What would you advise?