So, a lone female going to catch the last train of the day, but who is reluctant to join a rowdy crowd of drunken lads would still be left behind.
Oh well, I suppose at least it meets any equality bias concerns....
I think a bit of common sense would help the discussion.
In your case the female would likely be walking with intent and purpose which, if you take what resident drivers on this forum said above, would be something they would likely notice. If said female dawdled on the platform and was potentially out of the driver's view for a few seconds, then unfortunately the driver may assume she did not wish to board, hence be potentially left behind. I would imagine in your given scenario most people would run/jog to the next set of doors, which would not normally result in them being out of the driver's view for long, if at all, and if a driver sees someone hurrying for a set of doors I hardly think they would dispatch and go, unless they had already commenced dispatch procedure.
Not saying mistakes won't happen, or that every driver wishes to act like a customer service champion at all times, but ultimately the customer does need a bit of common sense when catching the last train and a responsibility not to mess about. In the rare event that the driver made a mistake, that is what customer service teams and help points are there for.
I have a solution which I doubt some forum members would like. If it were the last train I normally make sure anyone I can see remaining on the platform got on if they need the train even if they weren't physically moving themselves up to the train, give a shout to the dawdlers, look out for late-runners, give a hand to people with luggage/pram or mobility issues, and generally prefer to dispatch at 00 seconds rather than 30 seconds early where conditions allow. If I have just closed the doors (but not yet given the driver two) and someone came charging up the stairs I would in most cases let them on provided there is no good reason not to, because it is a nice thing to do and it avoids anyone being left in a sticky position. Unfortunately many of these things a DOO train cannot do, not to mention the driver may not be aware it were the last train. A guard can potentially babysit passengers if needed be alongside running the train service. An OBM type may or may not be able to depending on their specific list of responsibilities. A driver can keep an eye out within reason, but still has a job to do up front.
I don't think going down the road of ifs and buts is constructive or useful. Yes, she could have mobility issues or be disabled but in that case I would expect most to board at the nearest door and move about when on the train, or a carer would be alongside to help her. If the train is wedged full of drunkards and idiots then I would expect the driver to be aware hence paying more attention at stations. The probability of a vulnerable lone female being left behind by the last train because she was wanting to avoid a group of nasty BNP-types and the driver closed the door on her while she was dawdling along the platform outside the driver's view for more than a few seconds is not zero, but vanishingly small. Then again having a guard (almost guaranteed) or OBM type (possibly) onboard will look after that.
Could the railway do more to look after the customers in these cases even on DOO trains? Yes, perhaps. As someone already mentioned above, the railway can plan to have additional dwell times at stations, however increasing pressure on later services and engineering access requirements over the years meant the margin between the last train movement and start of engineering possession is often small, so the only way to get additional dwell time is either to compress possession window (which potentially leads to faults taking longer to fix and/or disruption over a longer period of time) or an earlier start of the last train from origin (potentially causing inconvenience to those requiring it at affected stations or breaking people's last journey opportunities). I don't know which one would cause more problems/give more benefits, but if a happy compromise can be reached then yes, we can have however long dwell time we want at each station in order to ensure every last possibility is catered for. We will just need to decide how long is long enough, whether the driver needs to leave his cab to ensure drunks fast asleep on the bench were all woken up and looked after, etc.
I don't know the specific circumstances of the OP's case so cannot comment further than what others have already said. At a quiet location on a quiet day, the driver will not likely hang about if they didn't see anyone wanting their service, especially if the train is already late as they will not necessarily know what is planned for the line after the train and what knock-on effect there could be.