During the American Civil War, he enlisted in August 1862 as a private in Company A, One Hundred and Twenty-sixth Regiment of the Pennsylvania Volunteers. After a term of service in this regiment, he reenlisted as a veteran in January 1864 in the Twenty-first Regiment, Pennsylvania Volunteer Cavalry, and served until September 1865. Mahon studied law, was admitted to the bar in 1871, and commenced practice in southern Pennsylvania.
He was the president of Baltimore & Cumberland Valley Railroad.
He was an unsuccessful candidate for election in 1876. Mahon was elected as a Republican to the Fifty-third and to the six succeeding Congresses.
He served as chairman of the United States House Committee on War Claims during the Fifty-fourth through the Fifty-ninth Congresses. He was not a candidate for renomination in 1906.
He was engaged in business in Chambersburg, Pennsylvania.
He died in Scotland, Pennsylvania, in 1916. Interment was in Cedar Grove Cemetery in Chambersburg.
He served as a member of the Pennsylvania State House of Representatives from 1870 to 1872. He was also a member of the commission having charge of the soldiers’ orphan schools of Pennsylvania.