Very few people replace their car battery. Like very few people replace their car engine. It happens, preferably under warranty, but it's not really something you consider when you buy a car.
If the battery degradation makes the car unfit to your needs, it's a bit weird because it would mean you were on the limit, but anyway it's more economic to sell the car as it is and buy another car. Someone will enjoy the old battery.