the countries that still use those just don’t have enough money to maintain a nuclear sub fleet
IRC the French have at least one diesel sub, the SMX-Ocean Range 30,000km.
They also have modern battery tech, the money and the tech to maintain/build nuclear subs. They have existing nuclear subs. The SMX-Ocean is actually quite modern. 2017 I think. Certainly more modern than most existing nuclear subs.
it’s cost efficiency not “better”.
Here's an article which explains why modern diesel subs can be quieter than nuclear subs: