I can't really say too much on this topic as I live on what's probably the safest train line in Sydney but I caught trains home at about 10pm on Wednesday nights for a semester and it was fine. Just stay near the guard's carriage, or if the station's dark where the guard's carriage is (whether it's the origin or destination station), get on a carriage where you see lots of people get on. If there's nobody, get on the carriage that requires the least walking at whichever station is more dangerous. Sit either on the door level seats, or upstairs, but never downstairs. And sit on the aisle seat. All common sense, really.