Joshua is simply stating the fact that as the father/head of the household, the policy of the household is that they will serve the Lord.
Joshua 24:15 And if it seem evil unto you to serve the Lord, choose you this day whom ye will serve; whether the gods which your fathers served that were on the other side of the flood, or the gods of the Amorites, in whose land ye dwell: but as for me and my house, we will serve the Lord.
The Bible is clear that the father/husband is the HEAD of the household.
Genesis 3:16 Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children; and thy desire shall be to thy husband, and he shall rule over thee.
As Christian fathers/husbands, WE are the rulers of our families/households and yes, we ought to lead our families in service of the Lord. This means laying down rules for our children, disciplining them, and teaching them the Bible.
Ephesians 6:1-4 Children, obey your parents in the Lord: for this is right. Honour thy father and mother; which is the first commandment with promise; That it may be well with thee, and thou mayest live long on the earth. And, ye fathers, provoke not your children to wrath: but bring them up in the nurture and admonition of the Lord.
Keep in mind also that under Mosaic Law, Israel was a theocracy and there was no freedom to worship other gods. The penalty for idolatry was death.
Deuteronomy 17:2-5 If there be found among you, within any of thy gates which the Lord thy God giveth thee, man or woman, that hath wrought wickedness in the sight of the Lord thy God, in transgressing his covenant, And hath gone and served other gods, and worshipped them, either the sun, or moon, or any of the host of heaven, which I have not commanded; And it be told thee, and thou hast heard of it, and enquired diligently, and, behold, it be true, and the thing certain, that such abomination is wrought in Israel: Then shalt thou bring forth that man or that woman, which have committed that wicked thing, unto thy gates, even that man or that woman, and shalt stone them with stones, till they die.
But as Christian men, we are the leaders of our households and ought to lead our households in worship of the Lord. If there are unsaved people, it is on them.
In the Church Age, there is no command to execute the unsaved. We preach the Gospel; there is no physical nation that God rules over.