This is why one should always maintain situational awareness when in public, especially when there are few people around. Keep a safe distance between oneself and others - if that means crossing the street or avoiding secluded places like alleys - then do it.
Crossing the street will not help they will merely know you for being afraid and follow.
Just like the Jungle movies when the man says show no fear that is the best attitude.
Show no fear, but be ready.
But first let me say that they will not attack a person who appears strong, these cowards are looking for the weak and the elderly. If they think they may get hit back they will not hit.
Yes. Always walk as far as you can from an alley entrance.