Why get involved at all? If the passengers are willing to squeeze on, let them get on with it. The driver and guard can access their respective cabs on a 175 without having to get close to passengers in the rest of the train. Pulling people off a crowded train and making them wait an hour for an equally crowded train is the definition of pointless.
If something happens on board they might require access to the saloon. One of the nastiest situations I've had to deal with was on a crush loaded train where some utter **** of a squaddie pulled the cord and brought us to a grinding halt in the middle of nowhere, in the dark, on a train that was over an hour late. I am not a small person and it took me several minutes to force my way through the train to reset it while people were panicking because after the emergency stop they could feel the crush as people tried to make room for me.
I wouldn't allow a train to operate in those conditions at the moment because I wouldn't be willing to force myself down the train if need be regardless of whether the passengers are willing to do so or not - why should we - I am a human being with rights as well? Consequently there needs to be room to move.
As for the legality of preventing access to the train, there may be an argument regarding failing to undertake the contracted service with due care etc etc.
Personally when it comes to making decisions about the safe operating of the train I would bear no consideration to that whatsoever, that is what the company employs legal teams for. If in the guard's judgement in the specific circumstances of the moment the train is full the byelaws entitle them to instruct passengers to leave it and if they refuse to have an appropriate person (I would rather it was a constable as most private security are rubbish) use reasonable force to deal with the matter.
Yesterday I refused upwards of 30 persons access to my train because I couldn't safely store their luggage/pushchairs etc and also ordered a person with a bike (having repeatedly politely asked first) off as well after they decided it was appropriate to wedge it and their bags across my cab door.
I have no doubt that they have legal rights too as a result of purchasing their tickets so I directed them to the customer relations department for redress.