It depends why the jobs are going away. If they’re being outsourced, trying to keep the jobs here makes sense. But if technology is evolving to the point where less human labor is needed in manufacturing, then we need to let that happen to allow for economic progress and efficiency.
Yes, it can be a choice between automation in US factories vs manual labor in Mexico. We’d still win if the factories are in the US because our exports would go up.