Note: Topguy has the short version, just above
This looks suspiciously like a mesh network. How should things look like if a 4th Pi was to be added to the deployment?
If you want a wifi mesh, using batman-adv and adhoc wifi mode is probably the easiest solution. Should work with Pi's built-in wifi adapter. You'd get a single network in the end.
If you really want multiple separate wireless networks, you need multiple wifi adapters working as AP and as clients.
- The Pi's built-in WiFi adapter can do AP or STA (client) but not both. (Ok, not completely true but you'd better believe it if you don't want to waste an awful lot of time.)
- Some 1/3 party USB adapter should be able to do both or possibly run multiple virtual client interfaces.
So in the worst case you would need internal WiFi + 2 USB adapters on each Pi that needs to belong to 3 networks. Best case would be internal wifi + one USB adapter capable of exposing virtual interfaces.
If you only want multiple separate IP networks, you could go with a single AP/SSID/security scheme, and segregate clients via VLAN or IP tunnelling. There are various options there (vlan, vxlan, openvpn, wireguard etc.), I'd say none would be cheaper than buying a few USB adapters if you value your time in any way.
(Finally you can also attach any network interface to multiple IP networks by giving it multiple IP addresses; but I suppose that doesn't match your needs as it doesn't provide any form of enforceable isolation.)