The younger Townsley was raised in the harsh St. Lawrence County winters in the shadow of the Adirondack Mountains. He attended preparatory school at St. Lawrence Academy in nearby Potsdam, and graduated from Union College in Schenectady, New York in 1876. Townsley spent a year in Sioux City, Iowa working as a civil engineer on the Covington, Columbus and Black Hills Railroad, then was appointed from Iowa to the United States Military Academy at West Point, New York in July 1877, graduating 14th out of 53 in his USMA cadet class.