Far-infrared CO and H_2O emission in intermediate-mass protostars