My rule of thumb would be to go to any funeral you have a connection to if you can, taking all other external factors into account, distance to travel or kids to have looked after, whether you'd have to take a day off work etc.
You'd be surprised at what can be considered external factors in relation to things like this, a classic is whether other friends are going and you wouldn't go normally but because they are you will too.
Otherwise, again depending on external factors, you could attend the removal the evening before the funeral.
In the circumstances you've described if you are very close to this friend who was in turn very close to the deceased relative then I'd try to attend either the removal or the funeral. If you are not that close to the friend or they aren't that close to the relative then I'd just offer my condolences and leave it at that.