Hi, we have goats. If you get them young (ours were 3/4 months old when we got them) they will follow you automatically. They usually view humans as the head of the herd and will look to you for directions. If you sit or stand still, they will forage all around you, but when you start moving they'll fall into line behind you. Our required no training in this regard. It's in their nature to walk almost single file.
We take them for walks every day to browse up the mountain, sometimes for hours at a time. We never allow them to walk ahead of us. This way, whatever we meet in the trail (large feral dogs, cars, predators, snakes etc.) will confront us first and we will have time to gather the goats to the side of the trail/road or put them on their leads if needed.
As they grow they do tend to push the boundaries a bit more to figure out if your position as head honcho is indeed well deserved, but you can train them to be good. We always walk with a strong walking stick or crook, which can be used to stop overexcited goats galloping past you. Sometimes they get a bit carried away - especially when going downhill - they love to run full tilt down a steep slope! I see them coming and block them with the stick and they don't pass. The stick can also be used as defense against feral dogs, which are a real risk here. We have also used
water pistols to train the goats if they keep breaking the rule. They hate water and usually won't think about trying to pass you again after getting squirted once or twice.
Walking each goat by itself a couple of times and teaching it its name with treats is also very useful as then when you are all together, you can call each goat to you individually if they are getting into trouble. We trained ours with their concentrate pellets, which they don't get much of usually and absolutely love. One or two pellets is
enough for a treat. They learn their names super fast and generally only need 4-5 repetitions of 'I call, you come, you get treat', to remember it forever and come running when you say their name!
Even if they are older when you get them and don't automatically follow you, goats are extremely intelligent (much moreso than sheep) and you can train them as above, with a few treats, to do pretty much whatever you like. They respond MUCH better to kindness than coercion. They will automatomatically resist any attempt to force them to do anything.
But to
answer the question straight up, I would say training them to follow is much better. They are clever, stubborn creatures and it's good if they see you as the leader of the herd, showing them where to eat and keeping them safe. With you in the lead, they learn to read your body language and will watch you constantly, reacting accordingly to how you respond to what lies ahead. I think if you walk at the back, they may assume you are a goat of no importance and will pay less attention to what you're doing. I am not sure they would even move if you tried to encourage them along while they were busy with their foraging. It would also be harder to steer them away from danger before they meet it, as they will get there before you do and if you try to run forwards to stop them, they will run forwards as well!!
As for how far they roam, we teach them different commands. Like 'let's go', 'woah' (everyone stop), 'get on' (disperse and forage), etc. If I sit down to signal we are stopping here for a while, they will wander around but they usually keep within visual distance. If they can't see you or each other they will keep in contact by talking so everyone stays together - although I think some goat breeds (e.g. Alpines) are quieter and may not do this.
Also, if you are worried about losing them in the woods, put bells on them. A different bell for each goat and you will soon know exactly where everyone is. They do tend to like to delve into deep bushes and disappear, so this really helps.