Yea CBP has the same search outbound as inbound to the US. Outbound enforcement, for money, guns, tech etc isn’t as heavily enforced though. This doesnt sound like a random thing. Most likley those officers suspect something for some reason. I mean, do you know how many people from Arab counties flew out of the US that day and were not stopped by CBP? Hundreds if not thousands.
And as a USC he could refuse to open those phones without any real reprocussions. A foreign national would likley be barred if they dont cooperate with CBP.