Can you flag down / contact an airplane with a handheld radio in case of emergency?
Yes, this is legal. As far as I understand, it used to be common practice, and some hiker's beacons still squawk 121.5. Nowadays, more advanced beacons are suggested, but it sounds like yours isn't working. Some police and EMT stations still monitor 121.5, too.