Is the firmware of the AirPods up to date? The airpod pro 2 firmware version that supports the hearing test is: 7B21
To use your iPhone or iPad to check that your AirPods are up to date, make sure you have the latest version of iOS or iPadOS. Go to Settings > Bluetooth, then tap the Info button next to the name of your AirPods. Scroll down to the About section to find the firmware version.
If the firmware is not updated yet, charge your AirPods at a power outlet and make sure that your connected device is connected to the internet
If you don't see the hearing test and your firmware and iPhone is up to date you might want to see if you're in a country where the hearing test is not avaliable yet see this list for the countries that the hearing test is avaliable in AirPods Pro 2 - Hearing Health Feature Availability - Apple