at 2.5 a child goes through a lot of internal conflicts. if there is any other loss, threat that happens in life at this stage, it gets quite difficult for the child to handle. i am not very clear about how things have been with him before this hitting habit started, but i will try to give some general pointers related to your concerns.
whenever there is some loss that a child faces, parents shouldnt rationalize it by giving reasons and logics. parents find it difficult to face child's sadness, so they try to cheer him up. but that makes the child feel that parents are trying to dismiss his sadness. so first thing u need to do is to empathize with the child's feelings after loss of grandparents presence. just tell him u understand how sad he must be feeling, and that he shoudlnt feel ashamed/timid to feel that way. when he finds a vent for his feelings, he will not need to act them out.
when he says in that 'unacceptable' way about other children, do not say anything. just look at him, smile and get back to what u were doing. sometimes kids say such things to irk parents and get attention.
no matter what, do not hit him to tell him to stop hitting others. i know how embarrassing it is for us when our kids hit other children. but then we cannot shout at them/ hit them and ask them to be nice to others. they get confused. they feel how it is ok for us to be not-so-nice and not ok for him for the same thing. they learn less from what we preach and more from what we do. so it is very important that we behave in the way we want our children to.
last, on-the-spot-management..when he hits and laughs, just tell him its not nice to hit anyone and divert his attention. try not to show your frustration/anger/annoyance/embarrassment, so that there is no external influence on him.
let me know if this helps