Here "two nations" stands for the two children. Each child will be the father of a nation. AT: "Two nations will come from the twins within you" (See: [[rc://en/ta/man/translate/figs-metonymy]])
Here "two peoples" stands for the two children. Each child will be the father of a people. This can be translated with an active verb. AT: "when you give birth to these two children they will be rivals" (See: [[rc://en/ta/man/translate/figs-metonymy]] and [[rc://en/ta/man/translate/figs-activepassive]])
Possible meanings are 1) "the older son will serve the younger son" or 2) "the descendants of the older son will serve the descendants of the younger son." If possible, translate it so that people could understand either meaning.