A Man Will be With Those Whom He Loves
Ibn Masud (radi Allahu anhu) reported: A man came to the Messenger of Allah (sal Allahu alaihi wa sallam) and said, “O Messenger of Allah! What do you think of a man who loves some people but does not go any nearer to their position?” He (sal Allahu alaihi wa sallam) replied, “A man will be with those whom he loves.”
[Sahih al-Bukhari and Muslim]
“Lam yalhaq bihim” means that he has not been able to come close to them in righteousness and good deeds but in the next world Almighty Allah will, by His Grace and Mercy, elevate him and bring him on par with the righteous and the pious persons because of his love for them.
And Allah Knows Best!