According to https://drafts.csswg.org/css2/visuren.html#z-index only fixed position implicitly creates a stacking context so the green descendent of the sticky element should be on top of the red box.

Descendant of sticky z=2
Sibling of sticky z=1