A federal judge has dismissed a lawsuit a Plymouth woman brought against two Plymouth police officers involved in the fatal shooting of her teenage son in January 2006. In a ruling issued Tuesday, US Magistrate Judge Robert B. Collings wrote that Officer Richard Tavares was justified in firing the fatal shot that struck Anthony McGrath, 16, in the back as the youth drove past him. Collings ruled that Tavares could have reasonably thought that McGrath, who had just driven toward him, was headed toward Officer Edwin F. Almeida, a codefendant in the lawsuit. Neither McGrath’s mother, Denise, nor a lawyer for the family could be reached for comment on Wednesday night.Globe correspondent Melanie Dostis contributed to this report. Travis Andersen can be reached at firstname.lastname@example.org. Follow him on Twitter @TAGlobe.