For an XYChart, by default, the grid lines stay behind all the layers. For your case, I can think of several possibilities:
(a) Your code may have used Layer.moveBack to put a layer behind the grid lines, or or PlotArea.moveGridBefore to put the grid lines in front of a layer.
(b) The red lines may not be grid lines. Grid lines are lines added to the chart at the position of the major ticks on the axes. Their colors can be set in XYChart.setPlotArea or PlotArea.setGridColor. There are another kind of horizontal lines called mark lines (added using Axis.addMark). These lines by default are on top of all layers. This can be configured using Mark.setDrawOnTop
To confirm if the lines are grid lines, please try to change its color a unique color (such as orange FF8844). Please check what API do you use. This can help to confirm if they are grid lines.
(c) The thinks behind the grid lines may not belong to the chart that draws the grid line. It is possible to overlay two charts together by using a MultiChart, or by DreaArea.merge. In this case, the bottom chart will be behind the grid lines of the top chart.
If you need further help, is it possible to provide an example code that can illustrate the problem? That can help me understand how the grid lines get in front of the layers.