I feel like "just a question of cost" is a heavy lifter here though.
Cost core to our resource allocation system, for better or worse, and if something costs a lot it usually means we can't do it as much. In this framing, cutting out animal testing would (often) mean medical research is slower. In this framing it's a question of where people are willing to put the dial on ethics vs results, and of course pumping the breaks in one place without universal buy-in just means the cruelty moves elsewhere.
I don't think the above 1-dimensional framing is the whole story though. You could imagine more standardized data sharing, so that the data that cost the lives of a few thousand rats could be used by others. And of course you could require (as drug trials do) that the study be registered before any experiment happened, and that the results be published regardless of the outcome. Some of these changes could actually make the science better, in addition to more ethical.
hopefully animal testing alternatives keep innovating enough that they, like some renewable energy sources today, become cheaper to make use of than their incumbents