It is strange that Tarek Mehanna connected with Batman, the comic-book superhero, when the role of villain is more befitting. Mehanna, a Bostonian who traveled to Yemen in search of training with a terrorist group in 2004 and later used the Internet to spread al-Qaeda’s message, was sentenced to 17 ½ years in prison on Thursday.