Sure, a credit based system or some kind of "remaining miles" calculation would work, I think. Personally I would prefer just pay for what you use with interchangeable systems, but we'll only get that if governments step in to prevent "ecosystem" style rent-seeking where every battery is incompatible with every other battery.
We know battery capacity decreases with age and number of recharge cycles. There's randomness due to how hard the battery was used, temperature, manufacturing defects, but you could make an estimate about "miles remaining" and charge for that.
Then when you visit the self-service battery kiosk, you can can select "40 miles" or "30 miles" or "27 miles" (etc.) from a list of options. Pick one and the corresponding set of batteries lights up. Maybe the kiosks already do something like this? I've not seen one in real life yet.