If it is a chool sponsered EF tour I doubt you can drink, the leaders would get into a lot of trouble. If it is not, you might be able to convince your leader to let you drink IF everyone else on the tour is 18 or over. If it is a mix of 18 year olds and younger the tour people won't allow you to drink whether or not you are legal. You are not going to have a lot of free time and I would not recommend sneaking out especially in San Jose where you can pass from a perfectly safe neighborhood to a dangerous one in a few blocks.
I'm not sure about the tours but you can drink there and nothing will happen.
If it is a school sponsored trip, probably not.
The summer of 2014, my friends and I are going to Costa Rica with our school through EF Tours. We know that the drinking age there is 18, and we'll all be 18 when we go. We will have already graduated from high school. The only thing is, we're not sure if EF Tours allows drinking? A group went to Europe a couple years ago and we heard that they drank, but they went with a a really lenient teacher...anyone travel with EF Tours and know of they'll allow that?