Maybe they could add a reservation queue to the bathroom as new functionality. That would probably be unnecessary blocking if people abandon their place in line.
Or try to predict availability based on recent queries. If there is only one stall open and someone checked its status 30s ago, respond that "maybe" a stall is free.