Batteries don't generally die while driving - usually it would be the alternator that dies, fails to charge the battery, and then the battery is dead and leaves you stranded. As such, changing the battery wouldn't solve the issue anyway (well it would until the charge in the new battery was depleted...)