AUSTIN, Texas—Rep. Beto O’Rourke’s campaign against GOP Sen. Ted Cruz casts the three-term congressman as the Democratic Party’s antidote to President Trump while at the same time bearing a striking resemblance to the president’s 2016 operation.

Like Mr. Trump during his romp through the Republican primaries two years ago, where his opponents included Mr. Cruz, Mr. O’Rourke is defined in Texas by an appeal to inspire more core supporters rather than persuade voters from across the political aisle, a powerful social-media presence...