As with many of these "choose the correct grammatical form" questions, there is more than one answer. That is because unlike (for example) gender in French or Russian, the tense of a verb actually carries meaning.
The "by ..." phrase indicates that a verb in the passive voice would be a good choice. And the general narrative is in the past, so a past tense would be good choice. Finally it would make sense that the "following" is a continuous action, so a continuous tense would be a good choice...
That leads to "was being followed".
There is no grammar error with "had been followed" but there is no clear requirement for a perfect tense. The perfect gives the suggestion that the act of following is complete at the time when the young man notices the fact.
On the other hand "was followed" is a poor choice, as it doesn't have the sense of an ongoing action.