That's security working as intended, so anyone just can't gain access even if they know your password ie 2FA.
You need to go through Apple to gain access to the account, along with supporting death certificate, court documents, etc.
https://support.apple.com/en-us/HT208510
And that's access to their iCloud/Appleid account. If you don't have the passcode, you won't be able to access the phone, but backups might exist on iCloud that you can restore from, plus whatever else you can access directly with an iCloud login.