No, there is no legal maximum. Ironically, the fuller the train the safer you are if there is an impact - you are less likely to go flying! If it is a controlled evacuation (i.e. substantial delay or something) it doesn't really matter how many people are on board. If it's an uncontrolled evacuation (fire etc) then yes, you're disadvantaged compared to an emptier train but that would be true even if there was a legal maximum imposed.
On the subject of legal maximums and capping the number of passengers permitted to travel, just how would that be enforced? It would mean an end to walk up tickets, which is one of the great pluses of train travel, particularly compared to travel by plane. You could never look at the beautiful sunny weather outside and decide to go to the food festival in Liverpool, for example, because you would have had to book in advance for any kind of event in all likelihood.
You'd also need to staff and barrier every single station across the UK as it would be utterly ridiculous to expect the driver/conductor to be able to police a cap. That's not going to do anything to lower ticket prices! How would you feel if you wanted to do a 7 minute journey and were told you couldn't because the train was at capacity and needed to wait an hour? Who would decide the capacity? What about kids travelling for free, presumably we would eliminate that or at the very least impose some kind of charge for the admin involved in booking them on a particular service to ensure the cap isn't breached? Would you need to book luggage too?
Can you tell I have some involvement in the industry? There are wider issues around capacity (as in the number of carriages/trains that can operate on the network rather than people on a train) that need to be looked at by the government and the way the franchise system has been developed means that train companies are severely limited in what they can do to improve their services. The whole thing is a mess. Personally I don't believe that renationalisation will result in considerable improvements, at least not for some time (substantial time) and it will bring its own problems and its own lack of incentives for improvements but I do certainly feel that the current system needs a shake up!
OP, I'm really sorry you felt ill. It's utterly unpleasant to feel that way and not be able to move or do much to improve your immediate environment. I completely empathise and hope you're feeling better now.