Why not 'arrest' the 3 gunman before the train arrived?
It baffles me why the marshall didn't confront the 3 gunmen before the train came into town, and tell them they were under arrest for loitering (or drinking in public, or spitting, etc.). After all, one vs. three is a lot better odds, than one vs. four.
If the 3 gunmen let themselves be arrested, fine. And if not, blast 'em away for resisting arrest with your trusty sawed-off shotgun.
In either case, the marshall could then face down Frank in a fair gunfight when he arrived in town.