Unfortunately the records for the RC parish for Graig (Graignamanagh) only go back to about the year that your James was baptised, so it will probably not be possible to work back any further. Catholic records for the early 1800s especially for rural areas often only start in the 1830s so getting back as early as 1818 is a lucky find..
James as a Catholic becoming a Professor of Mathematics in Trinity College would have been very unusual, as Catholics generally would not attend the collage even after it opened up admittance to them in 1790s, and the Catholic Church actually banned Catholics from attending up to the very early 1900s except with a special dispensation.
I checked the Alumni Dublinenses which is a register of the students, graduates, professors from 1593 to 1860 but did not see entry for James.. the professor of Maths listed for the college in 1877 is a Michael Roberts, assistant William Roberts, and in both 1880 and 1884 is a William Burside, assistant is Benjamin Williamson.
I eventually located James W. at the Catholic University, Stephen's Green, Dublin city in 1880 at the faculty of science teacher of 'Elementary Mathematics'. This University is beginnings of the modern University of Dublin (UCD), which later relocated to south County Dublin.