While others have correctly identified what the they/their refer to in a strict sense, a literal reading of the referents misses some subtleties in the rhetorical structure.
The repetition of "their children" (and the associated switch in who "their" refers to) is likely deliberate. Setting up the repeated structure "bringing up their children to bring up their children" invites the reader/listener to mentally continue the pattern. ("... their children to bring up their children to bring up ...")
The argument isn't limited to the grandchildren and great-grandchildren, the intent is that the pattern and argument would apply and continue to all descendants. The repetition of "their children" as-is brings that concept into the sentence in a way that explicit references (e.g. "bringing up our grandchildren to bring up our great-grandchildren") doesn't. It also differs from simply saying "all our descendants" by explicitly invoking the concept of an unbroken chain of parents passing things on directly to their children, versus passing something from the ancestor directly to a distant generation.
Reading things this way makes the otherwise unclear change of who "their" is referring to less unclear. The precise people to which "their" refers to in "bringing up their children to bring up their children" doesn't quite matter, as the construct is read as a whole, implying a whole collection of descendants, rather than any particular generation.