If the child is residing in the same household as the mother and grandmother, the child is the qualifying child of two taxpayers. Because the grandmother's AGI is higher than yours (the parent), you can agree between yourselves who will claim the child as their dependent. If they can't agree, the tie-breaking rule states that the parent is entitled to claim the child. If the parent had a higher AGI than the grandmother, only the parent could claim the child.
Please note that once the determination is made as to who will claim the child as a dependent, the taxpayer claiming the child is the only one who can treat that child as a qualifying child for all the other tax benefits, such as the child tax credit, earned income credit, child and dependent care credit and filing as head of household.