A large number of candidates are opting optional “X”. Hence it is better to choose optional “Y”, which is chosen by very few candidates?

As explained, the number of candidates to be selected from a certain optional is directly proportional to the number of candidates who opt for it. If the larger number of students opt for a particular subject then the number of students taking it selected for the mains will be equally large