Like a lot of questions regarding events in this film, things do not play out logically at all times and a certain amount of suspended disbelief is required to accept whatever is happening. The most logical explanation is that he is kept alive with "black magic" - something that creeps up a lot in the movie and can be used to explain a lot of the "unexplainable" occurances.
Alternatively, it could be a question of mass suggestion or mass hypnosis. Mola Ram would not actually be ripping anybody's heart from anybody's body, but only making those watching *think* that it is happening. During the first sacrifice we are shown what those present think they are seeing. During the second (attempted) sacrifice of Willie, we see what actually happens: Mola Ram doing as if he is holding a beating heart aloft, when in fact he is empty-handed. In the end, when Mola Ram and Indy are fighting in the collapsed rope bridge, it could be that Mola Ram is trying to use suggestion on Indy to give him a heart attack or something similar (the characters, meanwhile, all *think* that this evil man has awesome powers that allow him to rip hearts from chests, because they have "seen" him do so).
However, the maharajah's doll cannot be mere suggestion, because during the fight in the mine, Indy doesn't know that it's being used, but he feels the pain nonetheless. In fact, at the end of the movie, Jones uses this supernatural theme to his advantage when he tells Mola Ram "You have betrayed Shiva" and the stones perform their magic to bring about the end of Mola Ram and his cult of terror. The idea, so well expressed by Shakespeare, that "There are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy" is a theme that runs all through these movies. Jones repeatedly encounters events that can't be explained scientifically, such as the Ark destroying all the Nazis, the Holy Grail healing his father's wound, and yes, Mola Ram's ability to extract a still-beating heart from a living victim.