This scripture is not about the election for salvation, but about the election of Israel. God chose Jacob as a forefather of the people of Israel. The birthright was Jacob's, even though Esau was the oldest son. God placed Esau in second place, after Jacob. This Bible text does not mean that God literally hated Esau, but rather that He placed him second in rank. We find the same meaning in Luke 14:26. In this verse, Jesus does not mean that a person must hate himself and his family, but that God must be number One in your life, and that you and your family come second.
But God says this 1,400 years after Esau's days, not prior to Esau's birth. Esau sold his birthright and took heathen wives, who were displeasing to his parents. The descendants of Esau (the Edomites) were such great enemies of the people Israel, that they even wanted to destroy them. In the book of Malachi, God looks back on all the evils committed by Esau and his descendants and He is angered by it. That is why He says: " I hated Esau."
Neither of these Bible verses are about the eternal destiny of Jacob and Esau. They don't say that God had rejected Esau before the foundation of the world, predestinating him to perish for eternity.