Let us assume the number of boys = B and number of girls = G.
According to question,
B + G = 30
Lets us assume total weight of boys = W1 and total weight of girls = W2
average weight of boys = total weight of boys/number of boys
total weight of boys/number of boys = 20
W1/B = 20
W1 = 20B
average weight of girls = total weight of girls/number of girls
25 = W2/G
W2 = 25G
Data is not sufficient to solve the equation.
since we do not know either the average weight of the whole class or the ratio of no. of boys to girls.