After decades in which successive Republican and Democratic presidents have pushed to open U.S. and global markets, resentment toward free trade now appears to have the upper hand in both parties, making passage this year of a sweeping Pacific trade deal far less likely and clouding the longer-term outlook for international economic exchange.

Many Democrats have long blamed free-trade deals for big job losses and depressed wages, especially in the industrialized Midwest, which has been battered over the years by competition...