This question is mixing chronology and covenants.
There is a chronology to what happened in Luke and an aftermath whereby the old covenant no longer applies because Jesus dies. (And then establishes a new covenant at His resurrection)
There are similarities in that those under the old covenant still had to be saved by faith but they were awaiting a deliverer with the solution. Paul is saying the solution has happened and faith now has to be placed in the finished work.
But even under the old covenant there were prerequisites that needed to have been met.
Part of the prerequisites is being in covenant. And the Pharisees were under covenant by bloodline. Part of the reason why Jesus says that if in other cities the same miracles would have been performed they would have repented but in the old covenant only Israel belonged to God and was His DIRECT responsibility. The other prerequisite is faith, however they replaced faith which leads to works with works themselves being the demonstration of faith. Yet they faith was misplaced it was placed in the works themselves rather than the promised deliverer
“but that Israel who pursued a law that would lead to righteousness did not succeed in reaching that law. Why? Because they did not pursue it by faith, but as if it were based on works. They have stumbled over the stumbling stone,”
If they had at least had faith like Abraham who didn’t place his trust in the sacrifice of Isaac but in the God who asked him to sacrifice Isaac, even under the old covenant they would have been justified. Instead they put their trust in the flesh and what the flesh could do, and deemed this as righteousness. Only that righteousness belongs to God and is imputed, never earned.
“But it is not as though the word of God has failed. For not all who are descended from Israel belong to Israel, and not all are children of Abraham because they are his offspring, but “Through Isaac shall your offspring be named.” This means that it is not the children of the flesh who are the children of God, but the children of the promise are counted as offspring.”
Being born in the non-divorced southern kingdom of Judah from the lineage of Abraham was not a guarantee to being pleasing to God. They had to have faith like Abraham. It was Abraham’s faith that reckoned him righteous.
“I will get my knowledge from afar and ascribe righteousness to my Maker.”
Righteousness belongs to God and He has to input it.
Pleasing God requires faith.
“And without faith it is impossible to please him, for whoever would draw near to God must believe that he exists and that he rewards those who seek him.”