James' birth certificate lists his parents as John Wickham and Lily Bain. It also lists him as illegitimate. Do you know if this would be the reason he was adopted out?
It might be.
In the 1911 census he's 21, and Mary Bain (visitor) is 24 so sister, perhaps? But as she's older would it be unlikely to have two illegitimate children at that time?
No reason why not.
Can you find Mary Bain's birth certificate and see who it says her parents were?
I found the marriage certificate that Dod suggested, which lists James' parents as John Wood and Lily Bain... except that it also says he's 22 in 1926. So it can't be him. Welp.
I think it probably is him. If he lived in the Wood family from early childhood he might not have realised that John Wood wasn't his biological father. And he could have lied about his age, or the registrar could have made a mistake. Or maybe he didn't know for certain how old he was.
In the 1881 census, according to the LDS Church CD-ROM of southern Scotland, there's only one Lily Bain of an age to have a child in 1889. She is aged 18, the daughter of John Bain and Alison Low. So there isn't an obvious family connection between her and the Wood family.
You could look for Lily Bain, James Wickham Bain and Mary Bain in the 1891 census. On the other hand, you may not need to know any more about his parentage - what you really want to know is whether he could have been the father or grandfather of Andrew Wood.