Is God’s Purpose of Election Just?

NASB Romans 9:14 What shall we say then? There is no injustice with God, is there? May it never be!
15 For He says to Moses, “I WILL HAVE MERCY ON WHOM I HAVE MERCY, AND I WILL HAVE COMPASSION ON WHOM I HAVE COMPASSION.”
16 So then it does not depend on the man who wills or the man who runs, but on God who has mercy.
17 For the Scripture says to Pharaoh, “FOR THIS VERY PURPOSE I RAISED YOU UP, TO DEMONSTRATE MY POWER IN YOU, AND THAT MY NAME MIGHT BE PROCLAIMED THROUGHOUT THE WHOLE EARTH.”
18 So then He has mercy on whom He desires, and He hardens whom He desires.