New approach to predicting battery failure could help maintain electricity for millions around the world