The general problem your describing is Command and Control, or C2. Tailscale/wireguard/vpn is probably the best solution, but if you want to get weird with it, any site that allows user submitted content can be used.
For example, make one pi post to twitter, and the other pi can poll twitter. Substitute twitter with pastebin/lemmy/signal/instagram.