I guess they passed the test of the flood, while the rest of mankind failed the test.
After that Noah and his sons did have the remaining part of their lives on earth. (They did not go to heaven after the flood) They had to continue to believe and rely on the grace of God.
They did not live perfect lives after that. Noah did get drunk one fine day and allow his daughters to sleep with him. Ham disrespected his father and got cursed.
Nevertheless, Jesus descended from the lineage of Noah and Shem.
You are correct that Noah got drunk. But he did not sleep with his daughters, that was Lot who was seduced by his daughters who gave him much wine to drink for many days so he had no sound judgment, but it was also his fault about what happened as well. Noah's story is different from Lot's story. Here I will clarify for you:
This is Noah's story:
Genesis 9:20-27
Noah, a man of the soil, proceeded to plant a vineyard. When he drank some of its wine, he became drunk and lay uncovered inside his tent. Ham, the father of Canaan, saw his father naked and told his two brothers outside. But Shem and Japheth took a garment and laid it across their shoulders; then they walked in backward and covered their father’s naked body. Their faces were turned the other way so that they would not see their father naked. When Noah awoke from his wine and found out what his youngest son had done to him, he said,
“Cursed be Canaan!
The lowest of slaves
will he be to his brothers.”
He also said,
“Praise be to the Lord, the God of Shem!
May Canaan be the slave of Shem.
May God extend Japheth’s territory;
may Japheth live in the tents of Shem,
and may Canaan be the slave of Japheth.”
This is Lot's story:
Genesis 19:30-38
Lot and his two daughters left Zoar and settled in the mountains, for he was afraid to stay in Zoar. He and his two daughters lived in a cave. One day the older daughter said to the younger, “Our father is old, and there is no man around here to give us children—as is the custom all over the earth. Let’s get our father to drink wine and then sleep with him and preserve our family line through our father.”
That night they got their father to drink wine, and the older daughter went in and slept with him. He was not aware of it when she lay down or when she got up.
The next day the older daughter said to the younger, “Last night I slept with my father. Let’s get him to drink wine again tonight, and you go in and sleep with him so we can preserve our family line through our father.” So they got their father to drink wine that night also, and the younger daughter went in and slept with him. Again he was not aware of it when she lay down or when she got up.
So both of Lot’s daughters became pregnant by their father. The older daughter had a son, and she named him Moab; he is the father of the Moabites of today. The younger daughter also had a son, and she named him Ben-Ammi; he is the father of the Ammonites of today.
God bless.