We know from Galatians 4:22-31 that Hagar and Sarai allegorically represent two covenants: Hagar the covenant of the law and Sarai that of the promise.
Galatians 4:23,24,28
His son by the slave woman was born according to the flesh, but his son by the free woman was born as the result of a divine promise. These things are being taken figuratively: The women represent two covenants. One covenant is from Mount Sinai and bears children who are to be slaves: This is Hagar. Now you, brothers and sisters, like Isaac, are children of promise.
So, in Romans 9:6b ('For they are not all Israel which are of Israel') it is clear that those that are the children of promise are true Israel, whilst those that are the children of the flesh are not. It is also clear that the additional examples of Jacob and Esau are not to be taken literally but allegorically.
Romans 9:10-13
And not only this; but when Rebecca also had conceived by one, even by our father Isaac; ( For the children being not yet born, neither having done any good or evil, that the purpose of God according to election might stand, not of works, but of him that calleth; ) It was said unto her, The elder shall serve the younger. As it is written, Jacob have I loved, but Esau have I hated.
Paul is asserting that his fellow Israelites must be as (like) Isaac (children of promise) rather than like Ishmael (children of the flesh). Paul is not averring that Isaac was eternally saved and Ishmael was not. They allegorically represent the two covenants.
When Paul asks if God is unjust, he is asking if God is unjust to exclude the children of the flesh (those that pursue righteousness through the law) from being his children. In the very next chapter, Paul explicitly talks about this pursuit of righteousness:
Romans 10:1-4
Brethren, my heart's desire and prayer to God for Israel is, that they might be saved. For I bear them record that they have a zeal of God, but not according to knowledge. For they being ignorant of God's righteousness, and going about to establish their own righteousness, have not submitted themselves unto the righteousness of God. For Christ is the end of the law for righteousness to everyone that believeth.
God has mercy on whomsoever he wishes - that is, God provides the mercy - Jesus Christ - and anyone who puts their faith in Him is adopted as a Son.
Paul's conclusion is telling (v.30-32). It confirms that God does not foreordain some to eternal life and others to eternal damnation.