Hi,
Have you tried to make NxM number of VrayObjectProperties nodes, which cover all combinations of matte options and object ids.
Unfortunately we don’t combine different VrayObjectProperties, instead we use the one closest to the Node it is attached to.
Another option is to use the per shape ObjectID attribute (Select the shape and then go to Attribute editor->Attributes->V-Ray->ObjectID).
Hope it helps,
Teodor