If we didn't know better, we'd think Kali was the goddess of deus ex machina. Temple of Doom features one of the most exciting ending sequences of all time. Where else outside of Donkey Kong Country do you get a mine cart chase, a dash across a rope bridge, and man- (or monkey-)eating alligators? Temple of Doom sets a high standard for adventure movie finales.
But as exciting as it is, it doesn't make a lick of sense. We're specifically talking about how Indy dispatches Mola Ram. Unlike the ending to Raiders of the Lost Ark, in which Indy watches as the bad guy's hubris destroys him, Indy actually invokes a strange power to knock Mola Ram off the bridge.
First, Indy accuses Mola Ram:
INDY: You betrayed Shiva!
He also delivers a good Hollywood one-liner:
INDY: Prepare to meet Kali…in hell!
Hot stuff. It gets even hotter when he performs a weird chant, which causes the stones to burst into flame—something we don't see anywhere else in the film—and they burn Mola Ram, causing him to lose his grip and fall.
As Leah Schnelback of Tor points out, Hinduism has no concept of hell. Kali isn't an evil god, and wouldn't be in hell. Whoops, George Lucas.
Also, Shiva and Kali are two halves of a whole, like Ying and Yang. Mola Ram can't worship Kali and betray Shiva at the same time. Double whoops, George Lucas.
Plus, there is no heresy in Hinduism, so even if they were separate, Mola Ram could not betray Shiva. Triple whoops.
Even if the ending weren't rooted in a total misunderstanding of this religion and its relics, and featuring the problematic occurrence of Indy, a white guy, taking control of another religion's artifacts, it still wouldn't make any sense. It's just a convenient way for the writers to wrap up the story.
We'll call it deus ex Kali Ma.