I also thought that scene was a bit unlikely, but looking back it's not that bad.
When they first arrived they were busy trying to fix Anita/Mia, and then almost immediately they got the call from Fred. The plan was just to quickly accompany Leo to make sure he was safe on a short drive to pick up Fred, then return, where he could/would have charged.
And even though he was only at 4% charge, I figure that should have given him at least an hour left given that he was only sitting, so it was a calculated choice based on emotion that only went wrong when he ultimately had to perform unplanned physical activity. Had everything gone as planned, being at 4% wouldn't have been a problem for him at all.
He is a robot, but he was programmed to think like a human. The whole time it seems that emotion and family took priority over his own "wellbeing", caring for Mia and Leo.