Hmmm, I never thought of this idea before. Interesting concept.
I'd like to think that the Autobots would be smart enough to have some sort of line of command in case someone died. Prime might have sacrificed himself, but I'm betting that there would be someone to take his place. Assuming it's one of those societies where he has to actually name someone B4 he dies and hadn't done it yet.... cause, we all saw how well that worked out in the animated movie.
The All Spark is definitely a problem. If they destroy it they lose the ability to save their planet. Keep it around and the fighting will never stop. I suppose if the All Spark was the only thing that could save my home world I would not be willing to destroy it even to end a war.
On Earth the only beings that can stop Megatron from getting the cube are Prime and the remaining autobots, which at this point are Ratchet and Ironhide b/c Bumbles is out of commission and Jazz is dead (

). (Screw you Micheal Bay, I refuse to believe that the humans could successfully keep Megs or the Decepticons from getting the All Spark.) If Megs does get the All Spark then chances are they are not going to get it back and that simply is not an option. With no reinforcements coming anytime soon and little chance of beating Megs there are only two options: Die w/ Megatron getting the cube and ensuring the destruction of countless worlds or Die by destroying the cube and thereby stop Megatron's plans.
The only way Megatron would get the cube is with Prime's death anyways. If Prime dies w/o destroying the Spark Megatron wins and will destroy Earth and and the world. If Prime dies AND destroys the spark then Megatron..... would still kill all the humans and earth, but his plans for conquest would conceivably grind to a halt. If Megatron is going to kill everyone anyways and Prime can't stop him while alive then he might as well take out the thing that will help him the most at at the very least.
In short, if Megatron had not been destroyed by the All Spark, Earth would have been boned.