It is important to think sharp and react fast when you are in such situations.
You can do something like this:
- Start walking towards a nearby bus station or metro station instead of wasting some more time on trying to book a cab.
- Call a friend who can pick you up at the earliest
- Ask for a lift – a passing motorbike rider or a car driver may be kind enough to drop you at the nearby bus station or metro station. But it is not always advisable to take a lift from an unknown person.
- Go to a nearby public place and try to charge your phone. From there you may get some kind of transport or at least you will be safe.