He proved himself as he had done in the past and was put in charge of the prisoners
And the keeper of the prison put Joseph in charge of all the prisoners who were in the prison. Whatever was done there, he was the one who did it. The keeper of the prison paid no attention to anything that was in Joseph's charge, because the LORD was with him. And whatever he did, the LORD made it succeed. (Genesis 39)When Pharaoh had his dreams and Joseph revealed God's meaning, Joseph was elevated to second in command after Pharaoh. Egypt was possibly the world power at the time (2289 AM). So effectively, Joseph went from slave in jail to second in command to the emperor. Granted he was top prisoner at the time.
I do not think this promotion has been exceeded bar one. Jesus was crucified and dead 3 days prior to his resurrection. Then God subjected all things under him. From dead to ruler of the universe!
But in fact Christ has been raised from the dead, the firstfruits of those who have fallen asleep.
God has put all things in subjection under [Jesus'] feet. (1 Corinthians 15)