Let $(X_i), (Y_i)$ be two families of objects indexed by the same index set $I$ in a category with products. It seems obvious that if $X_i, Y_i$ are isomorphic for all $i$, then also the products $\prod_{i \in I} X_i$ and $\prod_{i \in I} Y_i$ are isomorphic:
We know that for each $i$ there exists an isomorphism $h_i : X_i \to Y_i$. Then $\prod_{i \in I} h_i : \prod_{i \in I} X_i \to \prod_{i \in I} Y_i$ is an isomorphism.
But doesn't this involve the axiom of choice if $I$ is infinite? We have to make infinitely many choices to get a family $(h_i)$ of isomorphisms. Or can AC be avoided?
Yes, the axiom of choice is being used. For example, suppose that there is a countable family of pairs $P_n$ such that $\prod_{n\in\Bbb N}P_n=\varnothing$. Let $S_n=\{0,1\}$ for all $n$, then there is an isomorphism $h_n\colon P_n\to S_n$, but still, $\prod S_n$ has $2^{\aleph_0}$ elements, while $\prod P_n$ has none.
The misleading part is that you write "there exists an isomorphism $h_i$", since it makes it seem that we chose one already. But we haven't, and we can't, not necessarily, without invoking the axiom of choice.
See also: