I’m sorry to hear about your loss.
Based on the circumstances where your grandmother was unconscious for several weeks, it would have been better to have consulted a priest during that time, who could may have chosen to perform a conditional baptism, and then the last rites. Only if it were a sudden illness or accident would it be appropriate to perform an emergency baptism yourself.
If your grandmother were Jewish or Muslim, then it would have been inappropriate to attempt a baptism. Same would apply to certain other religions, and even some other Christian denominations, which is why it would be best to allow a priest to evaluate the situation.
There is still hope though, even if she died unbaptized. If she died believing in God, she may have received a baptism by desire - thereby admitting her to heaven with our Lord.