Given an indexed family of sets $(X_i)_{i\in I}$, a canonical definition of Cartesian product is: $$ \prod_{i \in I} X_i = \left\{f\ \Big|\ f: I \longrightarrow \bigcup_{i \in I} X_i\ \wedge (\forall i\in I)\big(f(i) \in X_i\big)\right\} $$
I wonder if this definition is correct as well: $$ \prod_{i \in I} X_i = \left\{t\ \Big|\ t=(x_i)_{i\in I} \wedge (\forall i\in I)\big(x_i \in X_i\big)\right\} $$
Setting $\mathcal{X}=\bigcup_{i \in I} X_i$,
the domain of each family $t$ (in the second notation) is not explicitly set, but values $t(i)$, that is $x_i$, should be in $X_i$ and so only those functions $t$ compatible with $\mathcal{X}$ are acceptable.
Also, the cardinality of $\mathsf{Rng} f$ (in the first notation) is usually smaller than the cardinality of $\mathcal{X}$ and the same as $I$. That is not possible for $t$, since families are
surjections.
So each $t$ should have a distinct domain, with the cardinality of $I$.
Update
I reply here to a comment regarding indexed families.
I define an indexed family as an alias for surjective function.
Given a surjective function: \begin{align} x\colon I &\longrightarrow X \\ i &\mapsto x_i = x(i), \end{align} it can be denoted also with: $$(x_i)_{i\in I}$$ The range of the function $x$ might be denoted with: $$\{x_i\}_{i\in I}$$ or $\{ x_i \ \big|\ i \in I \} $. This is the standard definition I found in several books, e.g. Tourlakis, "Lectures in Logic and Set Theory" or Wikipedia.
$t = (x_i)_{i \in I}$ already means that $t$ is a function defined on $I$. A family of sets indexed by $I$ is a function on $I$. The right codomain can be deduced.