The doctor says he can't leave because then nobody will be there to help them. Why doesn't the Papal mainframe just take over? Then the doctor can leave and not die.
The Doctor's presence makes the other armies cautious.
Remember, Tasha Lem admits that any of the armies could crack open the shield if they wanted to--but none wants to be first.
The Daleks alone could easily fry the world, Mainframe or not, but razing Trenzalore is not an option so long as the Doctor can summon the Time Lords with a single breath.
The instant the Doctor left, the Mainframe would be unable to stand against the Daleks and other armies for long. Trenzalore would have burnt long ago if the Doctor hadn't been there with his finger on the "mutually assured destruction" button.
The Papal mainframe alone are incapable of fighting off the several forces that had gathered around the planet. They have limited resources and manpower. Also they were infiltrated by Daleks half way through the war. So... They were literally running out of resources and people. The Doctor was the catalyst that allowed the Papal mainframe to defend the town.