There are ways to calculate a batteries remaining life, usually you’d have a chip dedicated to tracking all of that. They can tell you a battery’s history, health, estimated charge capacity etc. So if the station detects a batteries life is low or it’s marked as chaged but it’s charged significantly below it’s initial capacity it can be taken out of rotation and inspected and fixed/disposed of if need be.
Personally I wonder if, once we have interchangeable batteries, if it will be more common to have several smaller, shorter life batteries that add up to a certain range. That way the recharge station only has to change out the batteries with a lower charge, and even if the battery system trips up and you get a borked battery your range would be slightly reduced not completely gone or halved