I have no doubt at all that they routinely search through people's phones, laptops, tablets, and similar. And if you watch those Passport Patrol style shows where they film in immigration/customs, you can see it is common on there too.
In the scenario you seem to be proposing, some random border agents are not only privy to top-secret NSA projects, but also have access to the data collected by said top-secret projects, and not only that, but they know everybody who's going to drive across the border on a given day, and not only that, but they pre-screen all of those people's data to see who's planning to marry for a green card so that they can manually screen the people's devices and then pretend it was random search.
Basically, these people are not the NSA, so assuming that they have the capabilities of the NSA seems a bit far-fetched.