There are ways. Placing regulatory burdens or legal liabilities on anyone running a social media instance would quickly make Mastadon untenable. Something as simple as manditory age verification might be enough.
Legal strategies won’t work effectively, just as they haven’t against BitTorrent pirating and sites like the pirate bay. Likely there will always be a jurisdiction where those restrictions don’t apply.