Why doesn't hydrogen displace metals from their oxides?
If magnesium reacts with water you get magnesium oxide and hydrogen.
  


True. So you can't put out a magnesium fire with water. It just burns hotter. 

$$ \ce{Mg(s) + H2O -&gt;T[aqueous] MgO(s) + H2(g) ^}$$


  
    But hydrogen is generally a lot more reactive than magnesium, so isn't this backwards?
  


No, in the above reaction you're reacting water with magnesium. The hydrogen is given off as a gas, though a tiny amount will stay dissolved in the water. 


  
    So why does it actually happen the other way round?
  


It will under suitable conditions. So with heat and under a pressurized flow  of hydrogen gas the reverse reaction will occur. 

$$ \ce{ MgO(s) + H2(g) -&gt;T[heat, pressure] Mg(s) + H2O(g) ^} $$