Am I the a-hole here?

Hey guys, MichiganMadness here. A friend of mine is like a brother to me. Has been for 15+ years. He is more family to me than my actual siblings. His son knows me as his uncle, and I don't argue that. He asked me years ago if anything happened to him, to take care of his boy. I have always stood by that.

Recently, he ended up arrested for protecting his son. I have been taking care of his son for one week today. He knows his son is with me. His (the fathers) mom knows he is with me. They are both ok with this as that's what he has always asked me to do. And that is what his son wants.

Well, i found out yesterday that my friend and his kids' mother are still technically married. Which means she has partial custody. But they have been separated for years. And I mean more than half the sons life ago. Until yesterday I was under the impression they were divorced, and she signed her rights over. So I never contacted the sons mother ( I was also asked not to by the father, son, and grandmother, and for reasons I will not get to into.) But from what I do know, the son does not feel safe at the mother's house, has seen is mom once maybe twice in a year and a half, while dealing with mental health issues as well as physical health issues. Admittedly, I only know what I am told. But again I was asked not to contact the mother. Yesterday she found out what was going on. And because the sin does not want to be there with her, the father doesn't want him there but left the decision to his son as to who he wants to stay with till we can figure all of this out, and even the grandmother (who is the sons emergency contact outside of his parents) all feel he is safer with me than with his mother. But his mother pretty much told us she was calling the cops if she comes to get him and we do not let her have him... am I the asshole for not going against the wishes of the sons Fathernal family.
I don't know what to do.. risk the kid? Or my family and career to protect him..
Am I the a-hole here?
Post Opinion