You absolutely have a moral/ethical obligation in that situation to tell the guy(s) right off the bat. Any other type of casual social situation not so much unless the guy is hitting on you believing that you're a woman.