From Christopher Kennedy's book, "Grace Under Pressure."
Why did one thief come to faith and not the other? Why were the presence and word of Christ effective in one heart but not the other? The answer to that mystery belongs to God. Both thieves had knowledge of Jesus. Both had proximity to Him. One believed. For one, intellectual knowledge registered in the heart and elicited a cry for salvation. The man's last prayer may have been his first prayer.
You might be praying for the Holy Spirit to turn a loved one to Jesus. You may be praying for a miraculous conversion. Your prayers are not in vain! Why some believe and others don't - that's a mystery. Whether we should pray for the salvation of others - that's not a mystery. Jesus taught His followers "always to pray and not lose heart" (Luke 18:1). Our loved ones' eternal destinies matter to us; think how much more they matter to God, who sent His Son to die for them and "who desires all people to be saved and come to the knowledge of the truth (1 Timothy 2:4). When we ray for others, we extend God's grace to them. (page 75-76)