Anyone could collect XP from trident killer farms as of 1.21.80.3 on Realms Server.
With Bedrock 1.21.92.1 patch, trident killers only generate XP if the player who threw the trident is currently online in the Realm. If they log off the Realm and other players are online, the trident killer will not generate XP.
Video shows example of XP generating, player logging offline and XP orbs disappearing. When player logs back online, orbs reappear to be collected by other players who did not throw the original trident.
Currently playing on 1.21.93 after initial bug fix for breaking trident killers where no XP generated at all. While XP orbs do generate now, they only generate when the player who initially threw the trident in online in the Realm.
This is working as intended, see MCPE-223964.