Retrieve Passcode from iphone backup files
Disclaimer: I'd make this a comment, but I only just joined the Apple branch of Stack Exchange and lack the 50+ rep to do so.

First and foremost, the keychain database that stores the device's secure information will only be present if a backup is encrypted with a password. If it's not, well, sorry, but you're out of luck.

If it is encrypted, then we need to clarify on what exactly you're asking for. I'm not entirely sure if the lock screen password is stored in the keychain file (lazy Google search results: unclear), but if it is, you do have a chance at recovering it, though most solutions cost money. Checkout this blog post as well as this software developer's website to get an idea of what your next step should be.