It is difficult to visualise the problem but perhaps some combination of ST_Difference and ST_Union could help you? If the lines do not exactly overlap you could perhaps first grow all geometries using ST_Buffer, then use ST_Union on the result, then maybe use ST_ApproximateMedialAxis to get a line? Good luck Peter