There is really no particular precedent for this, I would think, since the traditions that exist would have developed during the time when funerals would take place before those in distant cities could learn of the death of a Patriarch, let alone get there for the service. But in the modern era, when such travel is possible, I really don't know what has been done.
It is my guess that it would be the responsibility and privilege of the senior-most hierarch within the deceased primate's local church to serve the funeral, but that this hierarch would likely invite a Patriarch, if one was present, to serve the funeral. I would also guess that the Patriarch in question would express thanks, but decline.
Again, this is just my gut-level liturgical instinct. I may ask some of my Typikon-expert friends, since it is an interesting question. Of course, we won't have to worry about having to deal with the question vis a vis the Pope and the EP in our lifetime...
"It is my guess that it would be the responsibility and privilege of the senior-most hierarch within the deceased primate's local church to serve the funeral, but that this hierarch would likely invite a Patriarch, if one was present, to serve the funeral. I would also guess that the Patriarch in question would express thanks, but decline."
You may be right but I note that +Demetrios presided at the funeral of +Anthony of San Francisco rather than the senior priest of that diocese. Of course an Orthodox funeral service is different from a Roman one since as you know the funeral does not take place within a Divine Liturgy as it does in the Western Church. As far as I know, the senior cleric present always has the right to preside by his presvyia but you are also correct that that is often ceded to a more junior cleric.