My suggestion, a couple of days ago, was a emergency override command that comes from ground control that would unlock the cabin door if the pilot or co-pilot were locked out due to some reason such as this. The crew could contact the controller and declare their emergency via a second radio link from the passenger cabin.
I haven’t ridden on a train since 1962 when I was 7 years old, but I remember there was a line along the bulkhead above the windows that a passenger or conductor could pull to notify the engineer to come to a emergency stop. There should be some sort of similar ‘panic button’ or other device that could be initiated to send out a emergency signal to notify authorities that a situation was going on that required their override command to gain access to the cockpit.................