Even by the start of the film, Arthur is not the type of person to just run away from trouble, and he is even less inclined to do so by this point. Recall this earlier conversation with Randall after he was beat up when his sign was stolen:
ARTHUR: It was just a bunch of kids. I should have left it alone.
RANDALL: No, they'll take everything from you if you do that, all the crazy shit out there, they're animals.
Here Randall re-enforces Arthur's unwillingness to do something like just leave the train later on. Simply leaving the train would be similar to simply allowing the kids to run away with his sign; it's not in his nature by the time the film starts.
Although it isn't directly said, we get the impression from his character that before the event of the kids stealing his sign, he was more the type to just let things go; and as a result he was constantly walked all over. By the time of the events in the movie, he's reached a point where he has taken too much abuse because of that, and is no longer willing to just let people walk over him.
On top of this, Arthur had a gun in the subway and would have felt safer around these guys than he did chasing after the kids into the alley. While I don't think he knew or decided that he was going to kill them at this point, he certainly would have felt like they needed to be taught a lesson and didn't want to just let them get away with being "awful".
This part is just pure speculation, but it seems likely to me that if they guys had not started physically assaulting Arthur, he may have simply threatened them with the gun to feel powerful and scare them. This would have accomplished the goal of teaching them to not go around being awful for fear of reprisal, while also allowing him to take control and not be afraid.