Will not God then secure the rights of his chosen ones who call out to him day and night? Will he be slow to answer them? I tell you, he will see to it that justice is done for them speedily. But when the Son of Man comes, will he find faith on earth? Luke 18:7-8
In the parable of the widow and the judge, the judge was a character that could be won over with a bribe. But the widow, having no money to offer, knew that her case would never be served unless she persistently pestered the judge until he was tired of her. The judge was worn down by her constant pleading.
Using and unjust person in the parable does not liken God to him, but rather sets a contrast to what God is, a loving Father who cares for the needs of His children. He knows what we need before we even begin to ask, yet wants to hear our voice calling out to Him in prayer, like any parent would for their child. And, like a parent, God does not grant our requests for those things that are not going to help us obtain our heavenly goals.
Yes, we are to be persistent in prayer, but also we are to seek the things that are right for us, that will bring us, and those we pray for, closer to God.
May God bless you.