There shouldn't be much issue converting those 16nm DDR4 fabs to DDR5, it's really just an issue of swapping out the masks. That's assuming they haven't all already been converted years ago.
Even when there isn't an overlap, moving to the next process node usually isn't so much about replacing machines, but adding more machines. To oversimplify, you might not be able to convert one older DDR4 fab to DDR5, but sometimes you might be able to convert two older DDR4 fabs to one DDR5 fab.
Such conversions might not be the most cost-effective option in the long run (that unmodified fab could have kept selling DDR4 for years), but conversions might be significantly faster than building new fabs.