Both Pharaoh's initial decree of servitude and the following decree to kill the male children were not independent decisions, the decisions were made with the help and counsel of Pharaoh's advisors. Pharaoh speaks in plural, "Let us deal smartly..." and the description of the slavery is also in the plural, "And they placed upon them..." clearly indicating that he did not act alone. (Shmot 1, 9-11) Indeed, Chazal inform us that Pharaoh had partners planning the decree:
"Rabbi Chiya bar Abba said in the name of Rabbi Simai: Three [people] were involved in the counsel- Bilaam, Iyov, and Yitro. Bilaam, who provided the counsel, was killed. Iyov, who remained silent, was punished with afflictions. Yitro, who ran away, merited to have his children's children sit in Lishkat Hagazit (the Sanhedrin's chamber in the Temple)..." (T.B. Sotah 11a)
The gemara names Pharaoh's advisors, three in all, all of whom are familiar characters- Bilaam, Iyov, and Yitro. A glance at this esteemed list raises one major question: how did Pharaoh manage to gather these personalities from the ends of the Bible, skipping through time and space to assemble them on the banks of the Nile? The Chizkuni, among others, point out that this anachronistic meeting is realistically problematic:
"And if you say how is it that he [Bilaam] lived so long- from before Moshe Rabbeinu was born until the war with Midyan in the fortieth year after they left Egypt? And we say in Perek Chelek [the tenth chapter of Massechet Sanhedrin] that it says in the Book of Bilaam that Pinchas was thirty-three when he killed Bilaam?!" (Shmot 1, 9)
The Chizkuni questions the veracity of the aforementioned midrash based on a gemara which claims that Bilaam was relatively young when he prophesized about the People of Israel, which makes it impossible for him to have served as advisor to Pharaoh before the enslavement in Egypt. Other commentaries based a similar concern on a verse which indicates that Bilaam was killed in the time of Yehoshua. (Yehoshua 13, 22) Either way, other sources that describe bibliographic details of Bilaam's life make it quite impossible for him to be an adult in Egypt in the time period in question.
Chizkuni offer two solutions to this problem. One possibility is that this is not the same Bilaam, but rather one of the ancestor's of the Bilaam we are familiar with, who bore the same name. Chizkuni also raises the possibility that this assembly may have taken place at a later time, concerning a different piece of advice. In this case Pharaoh, Yitro, and Iyov were consulted in Bilaam's scheme to make Israel sin with the girls of Moav.
The inclusion of Iyov may be less problematic, as he is often considered an ahistoric character. The gemara brings a lengthy dispute about when he lived. (T.B. Bava Batra 15a) Only one possibility of the many, found in the Talmud Yerushalmi, is that he was one of Pharaoh's senior advisors. (T.Y. Sotah, Chapter 5)
Rambam briefly summarizes the various opinions about when Iyov lived:
"His time and his place are unknown, but some sages said he was in the time of the forefathers, and some said in the time of Moshe, and some said in the time of David, and some said he was one of the immigrants from Babylon [to Israel in the Second Temple period]." (Guide to the Perplexed 3, 22)
Due to the vast and extreme range of opinions Rambam draws the following conclusion:
"And this strengthens the claim of those who said he is not real and never existed." (ibid.)
It seems that if Iyov is more myth than man, he probably didn't pal around with Pharaoh. In this case the assembly described in the midrash is not meant to be a historical description of an event, but rather an attempt to describe three archetypes of advisors we meet in the Bible. This explanation also solves the chronological problem we have with Bilaam. Chazal's description highlights an integral characteristic these advisors share. Each of them explains world events through the lens of Divine reward and punishment.
"Bilaam, who gave the advice, was killed"
Bilaam used the idea of reward and punishment against the People of Israel like a double edged sword. He understood that the only way to successfully bring a curse upon the People of Israel is through their own sins; this was the only way he could get God to treat them with the strict attribute of justice. This is the essence of his advice to the king of Moav. (Rashi Bamidbar 24, 14)
"Iyov, who remained silent, was punished with afflictions"
Iyov believed it was best to remain silent, not to protest against heaven, lest he find out that there is both a Judge and judgment. Instead he spends his time discussing Divine reward and punishment, but his life's work remains unfinished. He hesitates, he questions the nature of Divine justice, of reward and punishment, in this world. Ultimately this leads to Divine retribution- Iyov is afflicted for questioning.
And on the other hand we have Yitro: "Yitro, who ran away, merited to have his sons sit in Lishkat Hagazit"
We are quite familiar with Yitro's advice. (Shmot 18, 14-23) It, too, is related to Divine reward and punishment. Yet Yitro sees it from a different point of view. Yitro's position is that reward and punishment can be used to bring internal peace to the People of Israel. When the people keep the mitzvot and do good God reciprocates with goodness. His advice to Moshe utilizes this principle and attempts to capitalize on it. To ensure that everything works out as it should it's important to teach Israel how they should act. And the only way the people can properly learn about God and His mitzvot is to break up the work and distribute the responsibility, which is essentially Yitro's advice to Moshe.
Yitro understands the principles of reward and punishment and uses them to his advantage. He refuses to be part of Pharaoh's corrupt discussion and the decree to kill the male children, and therefore he is rewarded, measure for measure, with children whose Torah lives on for eternity.
The midrash also makes it seem as though Pharaoh does not need advisors, which is why only those who agree with him are allowed to be heard. Otherwise why would Yitro flee and why would Iyov hold his tongue? Clearly the lesson of this midrash does not concern the advice itself, but rather the advisors.
There are plenty of strategic advisors out there, each one holds their own ideas of how the world works, and uses these ideas to assess and project the outcomes of certain actions. The difference between various advisors is not necessarily in their assessment of the impact of the actions they advise, but rather where they choose to place themselves. The difference is who they focus on and where they choose to place their faith. Perhaps it is also in their ability to ignore their desire for recognition and renumeration, and instead follow the internal voice that guides them and tells them where, and with whom, they should stand.