Is the likelihood a function of random variables ($X_i$) or a function of realisations of random variables ($x_i$)?

A likelihood is a function of the parameters for a fixed realization of a sample. For instance, a sample $(x_1, x_2, \ldots, x_m)$ drawn from binomial distributions with common parameter $p$ but possibly different (but fixed and known) $n_i$ will have likelihood for $p$ proportional to $$\mathcal L(p \mid x_1, \ldots, x_m) \propto \prod_{i=1}^m p^{x_i} (1-p)^{n_i - x_i} = p^{\sum x_i} (1-p)^{\sum (n_i - x_i)},$$ and this is regarded as a function of the parameter $p$. That is not to say that $n_i$ and $x_i$ must take on specific values, but rather, the emphasis is on how $\mathcal L$ varies with $p$.