Baldwin was elected to various public offices between 1780 and 1796. He was appointed high sheriff of Middlesex County in 1780, and was the first to hold office after the adoption of the state constitution. From 1778-1784, he represented Woburn in the Massachusetts General Court (the state legislature). In 1794, he was a candidate for election to the United States House of Representatives, and obtained all the votes cast in Woburn but one.