simply reverse their order in your call to Plotly.newPlot() like this:
Plotly.newPlot(myDiv, [trace2, trace1], layout);
If you don’t specify a fillcolor in your trace, it might be confusing because by default the first trace is blue, and the second one is orange. So it might have looked like the orange graph is always on top of blue, because it is.