For years, I lead walks for Ramblers and another independent walking club. All walks should have a leader and a back marker who knows the route.
Even a relatively short walk of 4-5 miles should have short stop built in for a drink and a breather, If possible, it should be in a place where people can duck behind a bush or a tree and pee.
If you can't wait, drop to the back of the group, ask the back marker to wait and duck behind whatever’s convenient.
Don’t be embarrassed about it. We all have to go and, whatever you do, don’t not drink so you don’t have to pee. Hydration is very important when walking.
There’s is a bit of mental barrier to get over for women about dropping our pants in a public place but you do get used to free-peeing.