Yes, and that could be accomplished in one of three ways. The easiest way to do that is just to include a simple provision in the final judgment. Should the spouse be ambivalent at the time of the final hearing, as to whether she wants to restore her maiden name because of children, I would recommend that you include a clause in the final judgment reserving jurisdiction for the court to come back at a later date, and file or issue an amended final judgment, restoring the maiden name.
If neither one of those methods have been used, the spouse can always come back at a later date, and file a new action for a petition for a name change. The result would be additional expense and cost.