I can understand how you feel I was the child in your kids situation my grandmother favored my cousin over me and it often made me feel angry as a child and adult I have done my best to let it go so that I do not resent my grandmother or cousin as it was not my cousins fault.
This is one situation you cannot fully control. I also think that mothers sometimes feel this loss when their sons marry and some take it out on their sons wives by feeling they need to compete.
The only thing you can do is move away so that you have a little breathing room, confront her and tell her how you feel in a respectful way away from the house and without the kids, or grin and bear it.
I sometimes dread that my sister in law will have a child because I think the same thing could happen to my child also.
For your children's sake though you should let their grandmother watch them and spend time with them because if you don't give them time with her they will see her as a saint and you will be the bad guy as you never let them spend a lot of time with their grandmother verses them seeing for their own eyes that she favors their cousin over them.
I wish you luck and peace in your home.