If a hanging is done correctly, it snaps the neck and kills the person instantly. It's actually a pretty humane method if done correctly. Of course, if the rope is too short, it's just strangulation, which is a horrible death. That's probably how it was done almost all of the time in ancient times as well; I simply have to grimace looking at the incredibly short ropes on old gallows. But people became more interested in "humane" execution in the 19th century, and I think that all modern hangings are done using appropriate methods. And if it is botched, that's bad, but I imagine that they undo the rope and try again rather than watching them suffocate. This is unlike the common lethal injection method where, for some reason, we give them a chemical that paralyzes them as well as a chemicals that kill them, so if it's done wrong they'll just lay there in pain, paralyzed and unable to say anything about it. Moderners are much more interested in how an execution looks that how it actually is.
Of course, electrocution is said to cause brain death instantly if done correctly as well. But it is a very nasty and complicated method of getting the same result. However, I doubt that this was done correctly - I doubt they did a lot of research into the subject of electrocuting an elephant, and the nodes appear to be attached to the elephants feet.