Hi again, Heather,
I had a look at various documents to see if I could find any son named John for Dr James Trotter. He does not appear to have had a son of this name from either of his marriages. Both wives were called Jane which complicated the matter. I believe John is a brother.
John Erskine Mar Trotter, to give him his full title, appears as the five year younger brother of James Trotter, then aged 8, in the Scottish census of 1851. He is the youngest in the family.
In 1861, when John EM. Is 11 yo, James has started studying medicine but is still living at home with his pa