In June 1864 he was a delegate to the Baltimore Convention of the National Union Party where he placed the name of Daniel S. Dickinson in contention for the vice presidential nomination on the ticket with President Lincoln.
In 1872, Tremain was elected as a Republican to the Forty-third United States Congress, defeating the incumbent Samuel Sullivan Cox.
In 1873, Tremain also served with his partner's oldest son, Wheeler Hazard Peckham, as special counsel to the State in the prosecution of Boss Tweed.
After leaving Congress, Tremain returned to private legal practice in Albany and then died in New York City while visiting.
Tremain's son Frederick Lyman (June 1843 – February 6, 1865) was a lieutenant colonel of the 10th New York Cavalry during the Civil War who was killed at the Battle of Hatcher's Run.