Brahma Vidya is the knowledge of God and spirituality (hence a form of Gyan Yoga) that helps the practitioner in attaining Moksha. Janak was a Raj-rishi and had the good sense and fortune to have a lot of spiritual stalwarts to guide him and I shall enumerate them here:
FIRST and foremost, his celebrated priest was Shatananda the son of Maharishi Gautam as mentioned in the following verse from the Baal-Kand of Valmiki Ramayan:
शतानंदम् पुरस्कृत्य पुरोहितम् अनिन्दितम् || १-५०-६
प्रति उज्जगाम सहसा विनयेन समन्वितः |
On hearing that Vishvamitra has arrived in Mithila, then the best king Janaka instantly forged ahead towards Vishvamitra, keeping his unreprovable priest Shataananda afore of the team, in deference to Vishvamitra. [1-50-6, 7a]
However, the more likely candidate could be Ashtavakra our SECOND candidate and the author of the Ashtavakra Geeta which is written in the form of a conversation between him and Janak. It is a celebrated book pertaining to the Advaita Vedanta system of philosophy and deals extensively with soul, liberation and Brahman.
The story of how Ashtavakra came to King Janak's court is detailed in the Mahabharat, Book 3: Vana Parva: Tirtha-yatra Parva:Section CXXXII-CXXIV
And when Ashtavakra was in his twelfth year, Swetaketu one day saw the former seated on his father's lap. And thereat he pulled him by the hand, and on Ashtavakra's beginning to cry, he told him, 'It is not the lap of thy father.' This cruel communication went direct into Ashtavakra's heart and it pained him sorely. And he went home and asked his mother saying, 'Where is my father?' Thereupon Sujata who was greatly afflicted (by his question), and apprehending a curse told him all that had happened. And having heard all, the Brahmana at night said unto his uncle Swetaketu, 'Let us go unto the sacrifice of king Janaka, wherein many wonderful things are to be seen. There we shall listen to the controversy between the Brahmanas and shall partake of excellent food. Our knowledge also will increase. The recitation of the sacred Vedas is sweet to hear and is fraught with blessings.' Then they both--uncle and nephew--went unto the splendid sacrifice of king Janaka. And on being driven from the entrance, Ashtavakra met the king and addressed him in the following words."
The young boy challenges Vandin, the chief contender in a battle of wits who avails himself of various system of Philosophy to combat his opponent but is ultimately defeated. Some verses from the Ashtavakra Geeta are given here:
Janaka said: How is knowledge to be acquired? How is liberation to be attained? And how is dispassion to be reached? Tell me this, sir.
Ashtavakra said: If you are seeking liberation, my dearest one, shun the objects of the senses like poison. Draught the nectar of tolerance, sincerity, compassion, contentment and truthfulness.
You are neither earth, water, fire, air or even ether. For liberation know yourself as consisting of consciousness, the witness of these five.
If only you will remain resting in consciousness, seeing yourself as distinct from the body, then even now you will become happy, peaceful and free from bonds.
You do not belong to the Brahmin or warrior or any other caste, you are not at any stage, nor are you anything that the eye can see. You are unattached and formless, the witness of everything - now be happy.
Righteousness and unrighteousness, pleasure and pain are purely of the mind and are no concern of yours. You are neither the doer nor the reaper of the consequences; you are always free.
You are the one witness of everything, and are always totally free. The cause of bondage is that one sees the witness as something other than this.
Since you have been bitten by that black snake of self-opinion - thinking foolishly that 'I am the doer,' now drink the nectar in the fact that "I am not the doer", and now be happy.
Burn down the forest of ignorance with the fire of understanding. Know 'I am the one pure awareness.' With such ashes now be happy, free from distress.
That in which all this appears is but imagined like the snake in a rope; that joy, supreme knowledge and awareness is what you are; now be happy.
The THIRD candidate of course is the learned rishi Yajnavalkya who was a regular at Janak's court. The conversations between him & the King are mentioned in the Brihadaranyak Upanishad and cover many topics related to the nature of soul and Brahman:
4.1.5 'Let me hear whatever any one may have told you. ''Gardabhiviplta, of the line of Bharadvaja, has told me that the ear (the quarters) is Brahman. 'As one who has a mother, father and teacher should say, so has the descendant of Bharadvaja said this that the ear is Brahman, for what can a person have who cannot hear? But did he tell you about its abode and support?' 'No, he did not. 'This, Brahman is only one footed, O Emperor.' 'Then you tell us, Yajnavalkya.' 'The ear is its abode, and the ether (the Undifferentiated) its support. It should be meditated upon as infinite. 'What is infinity, Yajnavalkya ''the quarters themselves, O Emperor,' said Yajnavalkya, 'therefore, O Emperor, to whatever direction one may go, one never reaches its end. (Hence) the quarters are infinite. The quarters, O Emperor, are the ear, and the ear, O Emperor, is the Supreme Brahman. The ear never leaves him who knowing thus meditates upon it; all beings eagerly come to him; and being a god, he attains the gods. 'I give you a thousand cows with a bull like an elephant,' said Emperor Janaka. Yajnavalkya replied, 'My father was of opinion that one should not accept (wealth) from a disciple without fully instructing him.'
Since the Brihadaranyak Upanishad is the older scripture I would put my faith more in Yajnavalkya but judging by the contents of these two scriptures, either of the authors could actually fit the bill.