Ukrainian troops have retaken a wide swath of territory from Russia, pushing all the way back to the northeastern border in some places, and claimed to have captured many Russian soldiers as part of a lightning advance that forced Moscow to make a hasty retreat.