The problem is not well-defined, since it says "randomly" without specifying a distribution. One might assume that when placing balls in boxes, each ball is equally likely to be placed in any given box. In this case it doesn't matter whether the balls are all alike, since this doesn't affect how they are placed. By contrast, if the balls are randomly placed such that each occupancy pattern of the boxes is equally likely, then it does matter whether occupancy patterns distinguish between different balls.
In case of the more likely intended meaning, where each ball is equally likely to be placed in any given box, there are $3^3=27$ possible placements, and for each pair of $N$ and $X_1$ you can count how many of them yield those values to arrive at the following joint probability mass function (multiplied by $27$ to avoid fractions):
\begin{array}{c|cc}
X_1\setminus N&1&2&3\\\hline
0&2&6&0\\
1&0&6&6\\
2&0&6&0\\
3&1&0&0
\end{array}
For example, for $N=2$ and $X_1=2$, there are $2$ choices for the box that contains the third ball and $3$ choices for which ball that is, for a total of $3\cdot2=6$ possibilities.