Hi
I’ve had this issue before and there isn’t a lot you can do BUT there is something the person who sold it to you can do ,the person who sold it to you can contact apple support and can exchange details and hopefully have the password reset but that’s if they are willing to cooperate
If they don’t do anything about it,if you bought it on eBay see if you can return the item and If you can’t return the item, start a case/claim to get a full refund
I hope all goes well for you
Any questions please ask
Thanks:)