While he was standing in prayer in the chamber, the angels called unto him: “Allah doth give thee glad tidings of Yahya, witnessing the truth of a Word from Allah, and (be besides) noble, chaste, and a prophet,- of the (goodly) company of the righteous.”
According to Maariful Quran,
The expression: ‘a word of Allah’ refers to Sayyidna ‘Isa
(peace be upon him). This term is used for him because he was created, in an unusual manner, simply by the will and command of Allah – without a parental linkage.
According to Anwar ul Bayan,
Who are the “Salihin” (Righteous)
This word is derived from the root word “salih” which denotes one who abstains from sins, performs virtuous actions and always turns to Allah. Such people are of numerous ranks, the highest from whom are the Prophets (peace be upon them) since they are “masum” (innocent/ protected from committing sins).
Sayyidina Sulaiman (peace be upon him) made the following supplication (dua), “Make me, out of Your mercy, from amongst Your pious (salihin) bondsmen.” (Surah Naml, verse 19) In numerous verses of Surah Anbiya Allah mentions that many of the Prophets (peace be upon them) were from amongst the Righteous (Salihin). From these verses it is gathered that the quality of piety is indeed one of great merit and an integral part of the good people.
Madani, Muhammad. Anwar ul Bayan. (vol. 1 p. 377). http://www.islamicweblibrary.com/wp-content/uploads/2020/04/Tafsir-Anwarul-Bayan-02.pdf
Shafi, Muhammad (2008). Maariful Quran. (Vol .2 surah 3 verse 39). English-MaarifulQuran-MuftiShafiUsmaniRA-Vol-2.pdf (islamicweblibrary.com)