A "set up" is a kind of betrayal, but not a synonym for betrayal.
For example, suppose you cheated on a test at school and told your good friend about it, who then told the teacher. You might consider you friend's action a betrayal -- but it would not be a set up.
In order to be "set up" you would have to have put your trust in someone to carry out some part of a (usually nefarious) plan, but that person turned around and betrayed you for some kind of personal advantage. In other words, it can't be random and it can't be haphazard. The set up has to be part of the plan.
To give a concrete example: in a recent film the two main characters went to a mob boss to borrow money to start a business. The mob boss was supposed to help them bribe the local government to get them the necessary permits, but instead he fixed it so that (after borrowing the money) they were unable to get the permits. He set them up so that he could take over their business, and they would still owe him money.
It is possible to be set up without knowing who set you up. In your example, the two characters could say something like:
Look outside, man! We just got here and already SWAT is coming through the fences? Someone set us up.
By this the speaker is accusing someone of telling the police about them in order to get some advantage, even something as basic as a reduced criminal charges.
This "personal advantage" doesn't have to be financial. It can be as basic as the pleasure of watching an enemy go to jail. Many thriller movies end this way, with the good guy at first set up by the bad guy, but in the end turning the tables so the bad guy is the one who is set up and punished.
Side note: If someone told the police without expecting personal gain, there are other expressions, for example:
someone tipped off the cops!
If they wanted to say that someone trusted told the police, without suggesting it was part of a larger plan, they could say:
someone ratted us out to the cops!
In standard criminal slang, a "rat" or a "snitch" is someone who tells the police about other criminals' plans.