Master items on a higher layer appear in front of all objects on lower layers, but they always appear behind all objects assigned to the same layer on document pages.
Layers are an invaluable part of a template’s construction. By default, every InDesign document contains at least one layer. Although there are many uses for layers, here is a list of uses that particularly benefit templates:
Maintain a separate layer for master items. Create a layer for master items and keep that layer above other layers. All the master items will always be in front of the objects on lower layers. This is the only way to keep master items in front of other objects on document pages without having to override master items first.
Template instructions. ...