Um, yes you can. There have been cases of passengers stuck on ECS trains and ending up in depots.
Only if they didn't pull the passcom or egress. Some people are so resistant to doing things like that, however, because it feels "naughty" or they might get "fined", that they won't do it in cases like this where it is justified.
I have been locked on a terminated Thameslink train where the driver wandered off without properly checking the train was empty and that all doors had released correctly (they hadn't, some sort of SDO issue had caused only some to release and I was right at the back, and he'd locked up and disappeared off before I got far enough forward). I used the egress and exited onto the platform (having tried the passcom first with no answer), reporting having done so to staff, the equivalent of using the "push bar" fire exit in this station - if it had one!
While staff can override the egress, if one was pulled on an ECS a driver who did this would frankly not be worthy of their job - if it's possible to pull one there's someone on board who shouldn't be, and that must be investigated once safe to do so. And if there are no staff on board, there's nobody to override it so it will work. Yes, you can lock every door out of use but when is that ever done in 2026 away from odd "grandfather rights" cases like the Ffestiniog?