hum … , so the game force the use of the second line …. how anoying ….
not many solution here :
1 put another depot for the red line (with a Y section to be connected from both side) and remove the problematic connection that cause the red line to switch to the other one
or remove the connection on the other side , by building a bridge or a tunnel for the green line
but i think the first choice is the easier and less expensive one
but now , what is the purpose of the red line ? , freight or passengers ? , is this connection absolutly neccesary or not ?