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 the parent, they can agree between themselves who will take the exemption. If they can't agree, the tie-breaking rule states that the exemption goes to the parent. 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 gets the exemption, the taxpayer with the exemption 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.