His grandfather left a bequest to his heirs who are poor; is it permissible for him to take from that bequest?
It is not permissible for a Muslim to bequeath more than one third of his wealth or to bequeath any of his wealth to his heirs. This has been explained in the answer to questions number 111918 and 111917.
Based on that, your grandfather's bequest is not valid, apart from what he bequeathed to the Haram, which should be executed with regard to one third only.
As for the second third that was bequeathed to the Haram and the third that he bequeathed to his heirs who are poor, these bequests are not valid and should not be executed except with the permission of the other heirs.
Al-Nawawi said: The scholars of our time are unanimously agreed that if a person has an heir, his will should not be executed with regard to more than one third, except with the permission of the heirs. And they are unanimously agreed that with the heirs’ permission, his will may be executed with regard to all of the wealth.
End quote from Sharh Saheeh Muslim, 11/77
Ibn Qudaamah said: To sum up: if a person leaves a bequest to his heir for which the other heirs did not give permission, it is not valid and there is no difference of opinion among the scholars concerning this. Ibn al-Mundhir and Ibn ‘Abd al-Barr said: The scholars are unanimously agreed on this, and there are reports from the Messenger of Allah (blessings and peace of Allah be upon him) to that effect.
End quote from al-Mughni (6/449)
If some of the heirs agreed to the bequest that is more than one third or the bequest to an heir, but some others do not agree, then in this case the bequest should be executed with regard to the proportion of heirs who agreed to it only.
If the heirs or some of them agree to the bequest of your grandfather to his heirs who are in need and are poor, then it is permissible to you to take some of it if you are poor and in need.
If a person is working but his income is not sufficient to meet his essential needs, then he is regarded as poor. But if his salary is sufficient, then it is not permissible for him to take from it.
Shaykh al-Islam Ibn Taymiyah said: Everyone who does not have enough to suffice himself and his dependents is one of the poor and needy. End quote from Majmoo‘ al-Fataawa, 28/570.
Shaykh Ibn Baaz said: If a person has an income that is sufficient for food, drink, clothing and accommodation, from a waqf or earnings or employment and the like, then he cannot be called poor or needy. End quote from Fataawa Ibn Baaz, 14/266
And Allah knows best.