Short answer. The father takes everything. Article 890 of the Civil Code provides that when ascendants are of different degrees, the legitime belongs entirely to the nearest in degree. Your mother's father is one degree closer than her grandfather, so the grandfather is excluded entirely.
What the law says
If the ascendants should be of different degrees, it shall pertain entirely to the ones nearest in degree of either line.
Civil Code, Article 890 — Legitime Of Legitimate Parents. Read the full provision →
The nearest degree excludes the more distant
Article 890 lays down a clear rule for cases where the closest ascendants are not all of the same degree: if the ascendants should be of different degrees, it shall pertain entirely to the ones nearest in degree of either line. A parent is one degree removed from the decedent; a grandparent is two degrees removed. When both are alive at the same time, the parent's closer degree means the grandparent receives nothing. There is no sharing between them.
Equal-degree rule and why it does not apply here
Article 890 also addresses the situation where the surviving ascendants are at the same degree but in different lines — for example, the maternal grandfather and the paternal grandfather, each two degrees removed, both surviving. In that case the estate is split equally between the maternal and paternal lines. But that equal-division rule only applies when both sides are at the same generational step. Here, your mother's own father and her grandfather are in the same paternal line and different degrees, so the equal-split rule never comes into play.
What this means for your specific situation
Your mother's father — her surviving parent — is the nearest ascendant in degree. He takes the entire legitime reserved for ascendants, and your mother's paternal grandfather is excluded. This is true even though both are in the paternal line. The grandfather's claim is simply displaced by the closer relative. If your mother also left a surviving spouse, that spouse has separate inheritance rights under different provisions; the ascendant share belongs to the father. The grandfather would only stand to inherit anything at all if the father had predeceased your mother or were otherwise incapacitated to inherit.
If your mother left a will
A will cannot override the legitime. Article 890 protects the share of legitimate parents and ascendants as a forced portion — the testator cannot reduce or eliminate it by testamentary disposition. If your mother had a will that attempted to give everything to someone else while her father was alive, the father can still assert his legitime. The remainder of the estate — anything beyond the protected legitime — can be distributed according to the will.