Is Paul saying in Romans 3 that all have the ability to be justified by grace? If so, how does this fit with the rest of his teaching about being selected before birth?
Your confusion comes from taking these two verses out of their larger context in Romans 3. When we take vs.24-25 out of context, we lose sight of what Paul meant when he used the word “all.” So by returning to the context of the passage, we find the intended meaning of the word “all."
Rom. 3:21 But now apart from the Law the righteousness of God has been manifested, being witnessed by the Law and the Prophets,
Rom. 3:22 even the righteousness of God through faith in Jesus Christ for all those who believe; for there is no distinction;
Rom. 3:23 for all have sinned and fall short of the glory of God,
Rom. 3:24 being justified as a gift by His grace through the redemption which is in Christ Jesus;
Rom. 3:25 whom God displayed publicly as a propitiation in His blood through faith. This was to demonstrate His righteousness because in the forbearance of God He passed over the sins previously committed;
Rom. 3:26 for the demonstration, I say, of His righteousness at the present time, so that He would be just and the justifier of the one who has faith in Jesus.
Rom. 3:27 Where then is boasting? It is excluded. By what kind of law? Of works? No, but by a law of faith.
Rom. 3:28 For we maintain that a man is justified by faith apart from works of the Law.
Rom. 3:29 Or is God the God of Jews only? Is He not the God of Gentiles also? Yes, of Gentiles also,
Rom. 3:30 since indeed God who will justify the circumcised by faith and the uncircumcised through faith is one.
Paul describes our righteousness may be found. The righteousness required to enter Heaven is the righteousness of God, given to us by God’s grace, apart from works. Notice in v.22 that Paul adds that this salvation is “for all those who believe; there is no distinction…” Paul is saying that the means of salvation is the same for both Jew and Gentile. There is no separate plan for Gentiles apart from Jews. We find this conclusion confirmed further when we look at the end of the passage, as Paul concludes God is the God of both Jew and Gentile.
Therefore, when Paul uses the term “all” in this passage, he is referring to both Jew and Gentile. The word “all" doesn’t refer to all humanity.
For a greater understanding of these things, we strongly recommend you listen to our entire Romans Bible study.