Not sure about 'mainframes' specifically.
But one of the easiest way to retire anything, is to stop doing new work on the older systems. Any new project should go on the new tech.
Soon enough you will see the older systems gone. It won't happen in weeks or months, but 1 - 2 years is enough.
At one point the whole banking industry used to de-facto run on Java. Eventually people just started doing new work on Python. These days Java is just another tech there.