In Genesis 49 we are given prophecies about the tribes of Israel. Information of interest to us in answering this question is found in verses 16 and 17.
"Dan shall judge his people As one of the tribes of Israel. Dan shall be a serpent by the way, A viper by the path, That bites the horse's heels So that its rider shall fall backward.”
We know that elsewhere in Genesis the serpent appears. The serpent deceived Eve and because of the serpent’s meddling all mankind was thrown backward into sin.
It is an interesting set of verses.
Now onto Ephraim for a moment. In Revelation instead of Manasses and Ephraim being listed (the two sons of Joseph), Manassas and Joseph are listed.
I believe we find the reason in Judges 17:1-18:31. As we read these verses it becomes apparent that the tribes of Ephraim and Dan went off into idolatry.
When we look forward to the listing of the tribes in Revelation 7 we read, “until we have sealed the servants of our God on their foreheads”. Undoubtedly the tribes of Ephraim and Dan do not fit this description of being faithful servants of God. In fact in the case of Ephraim, Hosea 7:1-16 reinforces this thought perfectly.
I’ve excerpted some relevant parts:
"When I would have healed Israel, Then the iniquity of Ephraim was uncovered, And the wickedness of Samaria. For they have committed fraud; A thief comes in; A band of robbers takes spoil outside… And the pride of Israel testifies to his face, But they do not return to the LORD their God, Nor seek Him for all this… Woe to them, for they have fled from Me! Destruction to them, Because they have transgressed against Me! Though I redeemed them, Yet they have spoken lies against Me.”
The last mention of the tribe of Dan in the Old Testament can be found in Amos 8:11-14. Within this passage we see God expressing His distaste for His people Israel to the Prophet Amos.
Amo 8:11 "Behold, the days are coming," says the Lord GOD, "That I will send a famine on the land, Not a famine of bread, Nor a thirst for water, But of hearing the words of the LORD.
Amo 8:12 They shall wander from sea to sea, And from north to east; They shall run to and fro, seeking the word of the LORD, But shall not find it.
Amo 8:13 "In that day the fair virgins and strong young men shall faint from thirst.
Amo 8:14 Those who swear by the sin of Samaria, Who say, 'As your god lives, O Dan!' And, 'As the way of Beersheba lives!' They shall fall and never rise again."
It would seem in this passage that Israel had become idolatrous and came to swear by the false gods and idols of the tribe of Dan, by which they had become known, and they therefore met with destruction.
In answer to our opening question then, it would appear that Dan and Ephraim were punished harshly for their idolatry and
that is why they are not mentioned in Revelation 7 as a surviving 'faithful' tribe