Half-life 1 Black Mesa Research Facility?
You have to go stand by the door on the front right end of the train. There are some floor markings. The guard only opens the door if you are standing there to get out.
Than follow him to the left hand side of the big door. You have to stand close to him for him to start entering the code. The door should open in a few of seconds.
Walk inside alone to the next door, and the first door should close.