If James was a policeman in Ireland, then he almost certainly worked for the Royal Irish Constabulary (RIC). It was their practice to post you away from the county that you (or your wife) was born in or normally lived in. So that would explain why he might be born in Longford but be in Westmeath in 1861. So the father, Thomas Elliott, farmer, might be expected to live in Longford.
If you are interested in James’ RIC service, you can get a copy of his service records from a number of different sources eg the Garda (police) museum in Dublin, the police museum in Belfast, or the Public Record Offices in Belfast and London. Normally those records will record county of birth. And sometimes you can work out where in the county he came from by analyzing information on the name of the person who interviewed him or sponsored his entrance. The police museum in Belfast will provide a copy of the service record for £25 (sterling). See:
https://www.psni.police.uk/index/about-us/police_museum/museum_genealogy.htm
It’s also worth searching on the fmp Petty Sessions Records as the name of the arresting police officer is often recorded, so you may be able to find a few cases he was involved in.
I can also tell you that to join the RIC he had to be 19 (18 if his father had served in it) and he had to have served 7 years before he was allowed to mary. So if he married aged 26 with 7 years service (which is just possible) then he was born c 1835, rather than 1841.
Most farmers would be listed in Griffiths Valuation. Looking at Griffiths for Co. Longford for 1854, I see 4 Thomas Elliotts in the county. One in Curraghmore, parish of Moydow, another in Abberyderg, parish of Taghsheenod, another in Drummeel parish of Clonbroney, and the last in Gorteenorna parish of Clongesh. Analysing those in more detail, I see that the one in Curraghmore only had a garden so probably wasn’t a farmer, the one in Abbeyderg had a 137 acre farm, the one in Drummeel had about 97 acres and the one in Gorteenorna had 42 acres. So it’s possible that your Thomas was one of the last 3.
http://www.askaboutireland.ie/griffith-valuation/index.xml
James’ birth was long before the start of statutory birth registration (1864) so you won’t get a birth certificate for him but you might be able to find his baptism. Do you know what denomination he was? (I note that the marriage in 1861 was registered in Mullingar. I’d need to see the certificate to determine the denomination but it was almost certainly Church of Ireland (COI). It couldn’t have been an RC ceremony, as they weren’t entered into the civil records till 1864). So you probably need to search the COI parish records for the parishes mentioned above for James’ baptism.
If he was COI, it looks as though the records for Taughsheenod are contained within those of Moydow parish. The originals were lost in the 1922 fire but a duplicate set exists, starting in 1821. These appear to be in the Representative Church Library in Dublin (but you would need to check that). Clonbroney also has records from 1821 but I don’t know where they are. (Possibly still held by the church). You would need to check with the RCB library. Clongesh records start in 1820 and are held by the RCB library. (A personal visit is required to view them).
Likewise if he served in London, he probably worked for the Metropolitan Police force. They too have records that you might want to investigate. See:
http://content.met.police.uk/Site/mpshistoryinformation