Under Section 49(1) of the Income-tax Act:
If a property is acquired by way of gift, will, inheritance, or other specified modes, then for the purpose of calculating capital gains:
Cost of acquisition = Cost to the previous owner (your grandfather, in this case).
Please note that even though your mother held it only from 2020 to 2025, if your grandfather held it long term, the property will qualify as a long term capital asset.
The indexation will be applied from the year in which your mother actually received the property (2020-21) and not from when your grandfather acquired it.
This was clarified in multiple rulings, for example in Manjula J Shah Vs. DCIT Bombay HC, affirmed by supreme court in various other cases.
Use your grandfather's acquisition cost as cost of acquisition, apply indexation benefit from 2020-21, compute capital gains using that indexed cost, the entire gain can be exempt under section 54 if reinvested in the new house..