Idolatry was simply the idea that certain beings had control over certain aspects of the world. On the other hand these agents were not mediators.
So today when you find that people worship a corpse they can claim that they are not doing idolatry because they are not claiming that the corpse created the world. On the other hand it does seem that they are claiming that the corpse is a mediator between them and God. That at least comes under the definition of idolatry to the Rambam.
But worse than this it seems they might be considering the corpse to have control over certain aspects of their lives. This would seem to be idolatry according to all opinions.
My feeling is to check from where the Rambam gets his idea of the mediator and that would seem to be Saadia Geon.
From the Talmud itself we have no source material on this subject. At best from the Talmud we have Shituf. That is like when people, would worship G-d along with the Baal. They thought God had control over heaven and the Baal over the earth. So they worshiped both together. That is Shituf. ="Joining." That is not the same as a mediator