I could easily see legislation that would require batteries to have a certain amount of life left in order for dealers to sell them, just like dealers cannot sell cars that have tires with less than a certain tread depth left or less than a certain brake life left.
That cost will be ultimately be eaten by the person who trades it in, not the person who buys it, as dealers will test the battery before giving a trade-in value to know if they will need to replace it. And, if it gets to that point, the continuing demand for ICE vehicles coupled with the depleting supply will raise the price of ICEs and eventually make EVs, even with a battery replacement, the cheaper option.
And, yes, batteries are going to get cheaper.