In 1894 O'Reilly was elected a member of the Legislative Assembly for Parramatta and sat for four years. He moved the first motion in favour of women's suffrage carried in the New South Wales parliament, but was defeated at the 1898 election. He became a master at his old school, the Sydney Grammar School, and continued there for 11 years. In 1910 he again stood for Parramatta, this time as a Labor candidate with the encouragement of Billy Hughes, but was defeated, and shortly afterwards obtained a position in the Sydney land tax branch of the Commonwealth Treasury. In 1913, Hughes asked O'Reilly about the views of his brother-in-law, Albert Piddington, on states' rights. O'Reilly cabled Piddington to clarify this, and as a result of Piddington's reply, "In sympathy with supremacy of Commonwealth powers", Hughes appointed him to the Australian High Court. As a result of opposition to his appointment and his belief that he was compromised by the exchange of cables he resigned without sitting in court.