I don't get made fun of for being a railfan, but that's mostly because I rarely ever tell people about my interest in trains. Also, since I'm homeschooled my situation is a little different. If kids are going to make fun of me, being a homeschooler is an easier target for them since it's something that many of them don't understand (kind of like railfanning in a way). Additionally it's a lot easier for me to pick which teens I hang out with, so I generally avoid the jerks that would otherwise give me trouble.
It also helps to be well-rounded. I have plenty of other interests (sports, music, history, and politics to name a few...) so that gives me plenty to talk about with my non-railfan friends. Also I use my love of photography as somewhat of a "mask" for railfanning. Sometimes I'll show people some of my better train shots along with the sports and nature pics that I also enjoy taking. It definitely helps out quite a bit, most of them seem to be impressed.