Let's say, hypothetically, that a country invades another country based on information that is later recognized to be false or to otherwise not constitute a sound reason for killing hundreds of thousands of people. Although people realize that the war was not justified, an new need arises to provide military force to prevent a civil war in the occupied country. My observation: the obligation is not for the invading country to provide that "service" but to provide compensation so that the service can be provided. It is a second crime to unilaterally dictate how foreign military control will be used in a country to prevent civil war.
An alternative: if the invading country is genuinely acting from a sense of moral obligation to reduce the harm of a potential civil war, and if that country respects the autonomy of the individuals in the occupied country, then the invading country should allow the people of the invaded country to select a plan to provide internal security. Perhaps people in the invaded country would want to use funds provided by the invading country to hire people from countries who will not use their military presence as a cover to exploit the victimized country's resources.
If the invading country is not acting toward utilitarian goals that respect the autonomy of the invading country, then it would seem that the invading country's actions would be better classified as colonial expansion. Although colonialism is usually viewed as intentional acts to exploit an occupied country, it would seem to be de facto colonialism when an invading force does the same thing under the self-deceptive excuse that they are performing a noble duty. An alternative is for countries to recall the atrocities committed by nations who believed that they were working toward a greater good and consider that restraint in invading other countries might be a better path to securing a peaceful existence than would be the policy of each country clinging to its ideology and destroying those that oppose it. Respecting the autonomy of nations is not a new idea. The Treaty of Westphalia, producing Westphalian sovereignty says something of this sort.
Note that it is easy to stand on stage and argue that there is a humanitarian need to intervene in a foreign country because the leaser killed 3,000 people, but if the subsequent war causes hundreds of thousands of deaths (which is a known risk of war), is the motive really humanitarian or is it a veil for colonialism? What alternatives might produce a good outcome with lower risk of atrocities?