Let's say say there are n1 mols of helium in the first balloon and n2 mols of nitrogen in the second one, which are equivalent to m1 grams of helium and m2 grams of nitrogen.
The molar mass of hydrogen is thus M1=m1/n1, same for nitrogen M2=m2/n2 hence the ratio of their masses is m1/m2=(M1n1)/(M2n2). Since both gases are rather similar, we can assume that n1~n2 hence m1/m2=M1/M2
The answer is B, Let me know if you get it right!
Heat is energy, and that energy would eventually cause the object to undergo a phase change.