Over here the chances of anyone carrying a firearm is very, very small.
Knives, slightly more likely. But every time I've encountered on, the person has shown it, more as an intimidation thing.
2 guys makes the situation more complicated. Not much more you could have done. Maybe jog up a driveway as if it was your house? I've walked up a driveway before when I knew someone was following me, but while there was still enough distance for them not to be able to run right up behind me.
Again, it's probably easier if they look really serious(such as hit you in the face with a brick), to just give them the small amount of cash you have. Credit cards can be cancelled, and their use can be tracked so if those are taken it's win-win, they might even catch the person.
Basically not getting killed or seriously injured is a good result IMO.
I'd rather have it, and not need it, than need it, and not have it!