As it is written, Jacob have I loved, but Esau have I hated.
Note 6 at Ro 9:13: God did not hate Esau and love Jacob while they were still in their mother's womb. He did choose Jacob over Esau as the inheritor of Abraham's blessing before they were born, but Esau could have walked with God and have been blessed by God if he had chosen to do so.
Mal 1:2-3 says, "I loved Jacob, and I hated Esau." This was written in approximately 557-525 B.C., thousands of years after the birth of Esau and Jacob, so this is not speaking of God hating Esau at birth. There is no mention in Scripture that God hated the individual Esau. This reference to Esau was referring to the nation of Edom (Esau's descendants) in the same way that the term Israel often referred to the entire nation of Israel, not the individual (Ge 32:28). God was saying that He had rejected the nation of Edom and had chosen the nation of Israel.
Paul quoted from Malachi, not to show that God hated Esau and loved Jacob while they were still in their mother's womb, but rather to confirm that the choice God made before they were born, based on His foreknowledge (see note 1 at Ro 8:29), was the right choice. Jacob went on to become a mighty man of God, and Esau despised the things of God. God's choice of Jacob didn't cause this to happen. This quotation from Malachi simply confirms that God's foreknowledge was accurate.
Jacob was called to a higher position than his brother, Esau, before they were born, but that does not display any rejection of Esau on God's part. That is comparable to God choosing certain people to be pastors while others are called to be deacons. The deacons are not inferior to the pastors. They are simply called to different positions. Jacob and Esau were called to different positions before they had done any good or evil, to illustrate that election was not based on performance but choice.