Unfortunatelly, I do not get z-fighting between lines on my computer. Maybe it depends on the graphical card? In any case, try the following ideas:
polygonOffset
has no effect on lines, use if only for polygons- turn off
depthTest
-ing in the material, so that drawing lines ignores depth data - set
renderOrder
of theAxes
instance, to insure it is drawn after the grid
Does the following demo work fine on your computer?