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):
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.