Observe that we have $$ \sum_{v \in V} f^{out}(v) = \sum_{v \in V} f^{in}(v) \tag{$1$} $$ since the flow on each edge contributes the same amount to both the LHS and the RHS of $(1)$. In addition, by definition of a flow, we have $$ f^{out}(v) = f^{in}(v) \quad\text{for } \forall v \
ot \in X \cup Y \tag{$2$} $$ By $(1)$ and $(2)$, we then have $$ \sum_{v \in X \cup Y} f^{out}(v) = \sum_{v \in X \cup Y} f^{in}(v) $$ Since $X \cap Y = \emptyset$, the conclusion is immediate then.