He was elected at the January 1910 as Member of Parliament (MP) for the usually Liberal Middlesbrough constituency in the North Riding of Yorkshire. When the constituency was divided at the 1918 general election, he was elected for the new Middlesbrough East constituency, but he was defeated at the 1922 general election by the Conservative Party candidate John Wesley Brown.
With rifts in the Liberal Party healed, the partys fortunes recovered at the 1923 general election, and Williams regained his seat. His return was short-lived, because at the 1924 general election he was unseated in a close 3-way contest by the Labour Party candidate Ellen Wilkinson. At the 1929 general election he stood as the Liberal Party candidate for Berwick-on-Tweed where he came close to gaining the seat from the Conservatives.