As I discuss in the this answer, by far the most popular school of Hindu philosophy is the Vedanta school, which bases its tenets on the doctrines laid out in the Brahma Sutras, a work by the sage Vyasa which summarizes and systematizes the philosophical teachings of the Upanishads. You can read the Brahma Sutras here. In any case, Adhyaya 3 Pada 3 of the Brahma Sutras describes the Brahma Vidyas, 32 lessons found in the various Upanishads which can each lead you to Brahman if you meditate upon them. You can see the full list of 32 Vidyas here.
One of these Brahma Vidyas is the Samvarga Vidya, and it is found in Prapathaka 4 of the Chandogya Upanishad. It was taught by a cart-driver named Raikva to the king Janashruti. In Adyaya 1 Pada 3 of the Brahma Sutras, Vyasa references this story in the course of demonstrating that only Dvijas (members of the first three castes) are eligible for Jnana. When Raikva agrees to teach Janashruti, he tells him this:
You have brought these (cows and other presents), O Sûdra, but only by that mouth did you make me speak.
In order to refute the objection that Raikva was willing to teach a low-caste person, and thus low-caste people are eligible for Jnana, Vyasa explains that Raikva is using the term in the sense of "consumed by grief", not in the sense of the name of the fourth caste. Then in Adhyaya 1 Pada 3 Sutra 35 of the Brahma Sutras, Vyasa demonstrates that Janashruti was in fact a Kshatriya:
And because his Kshatriyahood is known later on from the indicatory mark of his mention along with a descendant of Citraratha.
You see, later in the Samvargya Vidya of the Chandogya Upanishad, there is a mention of a Kshatriya named Abhipratarin Chaitraratha. Vyasa claims that this is sufficient to conclude that Janashruti is a Kahatriya.
Here is what Adi Shankaracharya says in his commentary on the Brahma Sutras:
Gânasruti cannot have been a Sûdra by birth for that reason also that his being a kshattriya is understood from an inferential sign, viz. his being mentioned together (in one chapter) with the kshattriya Kaitraratha Abhipratârin. For, later on, i.e. in the passage complementary to the samvarga-vidyâ, a kshattriya Kaitrarathi Abhipratârin is glorified... The fact now of Gânasruti being praised in the same vidyâ with the kshattriya Abhipratârin intimates that the former also was a kshattriya. For as a rule equals are mentioned together with equals.
Ramanujacharya says much the same thing in his commentary on the Brahma Sutras:
The kshattriya-hood of Gânasruti is further to be accepted on account of the Kshattriya Abhipratârin Kaitraratha, who is mentioned further on in this very same Samvargavidyâ which Raikva imparts to Gânasruti.... Now Abhipratârin is a Kshattriya, the other two are Brâhmanas. This shows that there are connected with the vidyâ, Brâhmanas, and from among non-Brâhmanas, a Kshattriya only, but not a Sûdra. It therefore appears appropriate to infer that the person, other than the Brâhmana Raikva, who is likewise connected with this vidyâ, viz. Gânasruti, is likewise a Kshattriya, not a Sûdra.
My question is, why does the fact that someone else in the same Brahma Vidya is a Kshatriyas imply that Janashruti is a Kshatriya? Is it always the case that when two people are mentioned in the same Brahma Vidya, they're of the same caste? Is that what Adi Shankaracharya means by "as a rule equals are mentioned together with equals"?
This reasoning seems rather peculiar to me, so can someone please clarify things?