Something like this happened to another federated/decentralized technology, XMPP. XMPP was used by Facebook Messenger, WhatsApp, and Google Talk to power instant messaging, then one by one those platforms disabled federation features and now barely anybody still uses XMPP. People fear something similar is going to happen to e-mail through GMail.
However, I think that in our case such a scenario is highly unlikely. First of all, the order of events is reversed--ActivityPub and Mastodon have been built after Twitter, as improvements over Twitter, and the current, not insignificant userbase has specifically left Twitter over bad features, management, or misaligned incentives, so there is essentially no risk of losing that userbase back to Twitter even if it joined the space.