You battle the first 3 Pokemon in the person's team at the moment you streetpass them.
For example,Person B has a team of Bidoof,Turtwig,Bayleef and Snivy.His first 3 Pokemon are Bidoof,Turtwig and Bayleef.Say person A streetpass person B at that moment.The Pokemon person A battle are the first 3 Pokemon in Person B's team.if Player B swaps Bidoof with snivy after person A streetpassed him,Person A will still battle the Bidoof,Turtwig and Snivy
TL;DR If the person you streetpassed changed his team after being streetpassed,the team he will use against you dosen't change
(And if you were talking about battling grunts in the other person's base,their Pokemon is actually determined by their trainer class and is not influenced by the original Pokemon owned by them)
Sry if this is confusing.
Which I bet it is
Source:Experience and http://www.serebii.net/omegarubyalphasapphire/supersecretbases.shtml