Will the volume occupied by a mixture of nitrogen and water be same as the volume occupied by them individually?
The idea behind the question is that you know the partial pressure of N$_2$ is 0.96 atm (= 1 atm - 0.04 atm). And you know that the partial pressure of all the H$_2$ that can be produced from the water is thus (1.86 atm - 0.96 atm)* 2/3 = 0.6 atm. [Ignoring the volume of liquid water, which is only ~1/1000 that of the gas.] From this you can determine the number of moles of H$_2$, which is equal to the number of moles of water = 0.6 atm *3 L/(302 K * 0.0821 atm L / mol K). 

Note the number of moles of water given in your answer isn't the total no. of moles of water, it's the number of moles of water vapor prior to the electrolysis.