I don't understand why you didn't change your direction when you realized that you should have done so earlier.
Your "gut" told you that they did not belong, this was probably not your first walk with the dog, and you know the neighborhood.
Nevermind that you never looked for another pair of dirt bags who were in the get away car, why walk into trouble?
You were really lucky that you did not get beaten for the measly amount of cash they stole from you, and if you were armed and again did not change your path (even to the other side of the street) you would be up to your azz is red tape or blood (theirs and yours).
While I will never give up without a fight, I refuse to walk into one that is easily avoidable.