>the people suffering may well demand the factory compensates them for the damage.
>knowing that it will be held liable, the factory will spend more money on researching
How will the people demand the compensation?
Will it be "through their wallets?" In that case, the factory will just be built in a poor area.
Your 'group of armed criminals' is what can enforce these rules. The only way the mechanisms to libertarianism can work is through the systems it rejects.