Photos are not directly tied to any Apple ID specifically.
You can extract the photos from one iPhone and then import them to the other iPhone using the Mac.
click here ➜ Transfer photos and videos from your iPhone or iPad to your Mac or PC - Apple Support
then here ➜ Sync photos between your Mac and iPhone, iPad, or iPod touch - Apple Support
You can Airdrop photos from one iPhone to the other. Though this may require transferring several groups of photos and not the entire 20K photos in one go.
click here ➜ How to use AirDrop on your iPhone or iPad - Apple Support
You can upload the photos to a cloud service such as Google Photos., One Drive, Dropbox etc.... and then use an app on the other iPhone to download them.