A reworking of the Hong Kong action film “Infernal Affairs” into an American gangster film by the master of urban storytelling, Martin Scorsese. Two young Boston cops work undercover on perpendicular paths. One man is a mole for the mob. Another is a rat for the cops.