Electric motors can last a really long time, assuming no defects, they should outlast the battery by a Longshot.
That leaves the battery, and an LFP battery should also last a hell of a long time, probably a decent way into a million km before you have degraded to about 80%.
If you got those key items lasting, then it just depends on how well the rest of the car holds up, but replacing small parts while the motors and battery works is probably always going to be more cost effective.
The problem is the battery is a wildcard still.
We know how long those LFP batteries should last in a car, but they're also pretty are in cars and we don't have that real world data yet.
I also fear that OEMs will still gouge us on replacement batteries 15 - 20 years from now when costs are even lower and replacing the battery shouldn't be so expensive.
The battery doesn't have to fail for the car to be useless. One of those circuit boards that holds it all together goes and it's "whoops, we don't make that any more".