I was hanging out with a friend who has Pokemon X/Y, and we wanted to trade. We were registered as friends and had interacted in-game via both internet and Streetpass before, but we weren't able to see each other. Since we were at his house and he was connected to the internet, I tried connecting to the internet, too, and that worked. Can you not connect to another player via Streetpass if they are connected to the internet? Or was this a fluke?
Streetpass and Wi-Fi require exclusive use of the same radio - they can't both be on at the same time. If the 3DS is able to connect to the internet using a connection registered in your Internet Settings, it will do so automatically and disable Streetpass. Once internet connection is lost, it will switch back to Streetpass.
Note that you can battle/trade etc over local wireless or IR by selecting the Battle option in the PSS menu (top-middle of the touch screen), you don't require internet or Streetpass when you're both sitting in the same room.