Inspired by recent experiments, we study a short superconducting junction of length L ξ (coherence length) inserted in a dc-SQUID containing an ancillary Josephson tunnel junction. We evaluate the nonequilibrium occupation of the Andreev bound states (ABS) for the case of a conventional junction and a topological junction, with the latter case of ABS corresponding to a Majorana mode. We take into account small phase fluctuations of the Josephson tunnel junction, acting as a damped LC resonator, and analyze the role of the distribution of the quasiparticles of the continuum assuming that these quasiparticles are in thermal distribution with an effective temperature different from the environmental temperature. We also discuss the effect of strong photon irradiation in the junction leading to a nonequilibrium occupation of the ABS. We systematically compare the occupations of the bound states and the supercurrents carried by these states for conventional and topological junctions.