The settlers moved onto the Indians' land, and while _____ two groups sometimes got along, they fought when food became scarce.
The phrase "those two groups" would be a natural sounding choice, especially if we were having a conversation, but I would typically use 'those' only if there were a another group (even if that group was just implied and not written explicitly). For example, Those two groups usually got along, but this other group didn't get along with anyone.
The definite article is the correct choice here, because you are referring back to two specific groups that were identified in the beginning of the sentence. None of the other options on the exam are grammatical. I think they made the question a lot easier by excluding 'those' as a choice.