If you
- are the original purchaser of the iPhone
- have proof of purchase from Apple or an Apple Authorized Reseller that clearly shows your name and the phone's serial number
you can file an Activation Lock support request. (I don't know if the regular link would work or if you'd need to get in touch with Apple some other way, so they would understand that you are not just talking about a forgotten Apple ID password, but about a scammer's Apple ID being associated with the phone.)
How to remove Activation Lock - Apple Support
Otherwise, you're hosed.
Paying the scammers would not be a good idea. You would be rewarding criminal activity – and there would be no guarantee that the scammers would not simply take your money, then either (a) try to extort even more out of you, or (b) leave you with a bricked phone.