The correct option is A Everybody but Ram's brother applied for the test.
We use but as an alternative to except (for), apart from and bar to introduce the only thing or person that the main part of the sentence does not include. It is often used after words such as everyone, nobody, anything, anywhere, all, no, none, any, every.
But is used as a preposition when we put a noun or pronoun after it.
Option A is correct. It means that Everybody except Ram's brother applied for the test. The noun phrase 'Ram's brother applied for the test', which also acts as an object for the preposition 'but', follows it.
Option B is incorrect because 'but' has been used as a conjunction.
Options C and D are irrelevant to the text.