I am part of a party that is running through the Ironfang Invasion and when we first heard about the troglodyte cave, it sounded like an ideal place to secure the villagers. Unfortunately, when we got there, we found an emissary of the hobgoblins just outside the cave.
We took this as a sure sign that the trog cave wasn't a good place to bring the villagers as the hobgoblins already knew about it.
Our GM seemed surprised by our decision to abandon the cave. Are we missing something here? Have others just killed the emissary and taken the cave? Or made some sort of deal with him? It seems no matter what, if the hobgoblins know about the cave, it's not a good place to relocate the villagers.
The wording in the AP might be vague on this point, but I thought the hobgoblin emissary wasn't supposed to arrive until after the PCs had explored the troglodyte caves. Perhaps your GM decided to alter the order of events without thinking through the consequences it might have for your party.
You certainly did nothing wrong. You can keep searching for a place to settle your refugees -- if your GM knows their business, they can find ways to help with this -- or else you can take the fight directly to the hobgoblins.
(Maybe that emissary left a trail behind that one of your PCs can track? Surely that's not unlawful!)
The GM has a lot of leeway in what order encounters happen. It is the intent of the AP storyline to have the Emissary arrive after the PCs have explored the Trogolodyte cave. It gives the option to have the Emissary arrive as the PCs are exploring the cave or immediately afterwards. Now if the PCs have dallied or gotten sidetracked, as this group seems to have done, then the GM can determine that the Emissary has arrived before the PCs.
Indeed the Ironfang Legion know about the Hobgoblins in Fangwood but not necessarily where their cave is located. There are definitely cons and pros to taking over the cave. But ultimately this is just the beginning of the adventure and any decision made here won't have an effect on the final outcome of the adventure. Don't fret your decision.
Ultimately the story will continue along. It already sounds like your GM has had to take into consideration what your party has done and that's just the way role-playing goes. The players and the GM make the story and the AP has suggestions and guidelines. Going off track what the AP writers envisioned is what makes each adventure unique, exciting and great.
Judging by past GM-only discussions, this is something of an issue with the adventure itself. You're encouraged to wipe out the troglodytes in order to steal their home even though (a) they probably haven't done anything to you, and (b) the hobgoblins know about the cave.
If you were a GM, you could make small changes to the adventure to fix these problems.
As a player, you can either find an excuse to explore the cave (because exploring monster-filled caves is how adventurers level up): "Let's go in and try to talk to the troglodytes and see if they'll grant us sanctuary and only fight them if they attack first."
Or you can avoid it entirely and hope that doesn't cause too many problems for the GM.