If your mast hits an overhead powerline, unless you get caught up in it somehow the boat would presuambly drift away after a bit.. (maybe?)
Things to do:
1. Stay on the boat.
2. Best not to touch anything metal - cabin cushions and lifejackets make reasonable insulators so sit on them or cover bare metal metal rigging with them.
3. Freeze. (Pretend you've got a rattlesnake in front of you!
) Don't move unless you have to and stay there until help arrives or the boat drifts clear.
If the boat is on fire, then obviously you have to move to grab the fire extinguisher. Modern fire extingushers are supplied with insulating plastic holders, so you can get them without fear of electrocution.
Over here (down under) the powers-that-be usually plastic-sheath any power cables that might be hit by boat masts - it's not idiot proof but does help. You guys don't do that over there?
It's a shocking experience, but one that is possible to live through