In terms of safety, the key mistake was made as soon as the pilot made the decision to land on that runway. The corrective emphasis should be on determining why this mistake was made and taking whatever steps are necessary to prevent that mistake in the future. Especially in transport category airplanes, the crew should always calculate the required landing/rollout distance for the current landing weight, wind, atmospheric (temperature/pressure) and runway surface conditions, and this should be compared against the approach plate / airport diagram / A/FD. In most transport category airplanes this can all be computed by the FMS and it is standard procedure to do this on every single flight.
The question of what to do after the key mistake is still valid, though. I would say it depends on when the pilot recognizes that the runway is too short.
If recognized on approach, a simple go around is clearly called for and perfectly safe.
Once the wheels touch the ground, the decision gets a lot more complicated. The pilot must choose whether to reject the landing or commit to it. If you recognize it as soon as you touch down, you would probably be able to apply takeoff power and get airborne again safely. Once you've started to brake and decelerate, there will quickly come a point-of-no-return. Since you're starting at high speed, you're using up a lot of runway early in the landing rollout. Also note that in many airplanes it can take a significant amount of time to retract spoilers, stow thrust reversers, and spool the engines back up to takeoff thrust. You'll be consuming a lot of runway during this time. (At a constant 120 knots, you'll use up 2,000 feet of runway in just 10 seconds.)
In my opinion it's far better to commit to a landing. If I'm going to overrun the runway, I'd rather it happen at low speed. If you try to take off again and don't make it, your overrun will be at much higher speed, and destructive energy in a crash is proportional to the square of your ground speed.
So there's a gray area... you could attempt to take off again if you were dead certain you were going to make it. Otherwise, it's most likely best to "cut your losses" and get the airplane as slow as possible when you run out of runway, in order to minimize damage & injury. If you can get it down to, say, 30 or 40 knots, you're likely to escape without any serious injuries (the plane may take a bit of a beating, though, depending on what's beyond the end of the runway). If you do it at 120 knots, all bets are off. And you did mention a specific runway with a cliff at the end; obviously that would have to factor into the decision-making process. It may be that you simply realized your mistake too late and there is nothing you can do about it.
This leads me back to the original point, which is that the key mistake was made as soon as the pilot decided to set up an approach to that runway. The best bet is to make sure that never happens.
EDIT: After reading about the specific incident you referred to, it seems that the pilots simply mistook the airport itself for a different one with a longer runway. So it's not necessarily that they failed to calculate their required landing distance; rather they just landed at the wrong place. This is a different, but equally bad (or worse) mistake, discussed to some extent in the comments below.