, 118 route de Narbonne, 31062 Toulouse cedex 4.We study random transitions between two metastable states that appear below a critical temperature in a one dimensional self-gravitating Brownian gas with a modified Poisson equation experiencing a second order phase transition from a homogeneous phase to an inhomogeneous phase [P.H. Chavanis and L. Delfini, Phys. Rev. E 81, 051103 (2010)]. We numerically solve the Nbody Langevin equations and the stochastic Smoluchowski-Poisson system which takes fluctuations (finite N effects) into account. The system switches back and forth between the two metastable states (bistability) and the particles accumulate successively at the center or at the boundary of the domain. We explicitly show that these random transitions exhibit the phenomenology of the ordinary Kramers problem for a Brownian particle in a double-well potential. The distribution of the residence time is Poissonian and the average lifetime of a metastable state is given by the Arrhenius law, i.e. it is proportional to the exponential of the barrier of free energy ∆F divided by the energy of thermal excitation kBT . Since the free energy is proportional to the number of particles N for a system with long-range interactions, the lifetime of metastable states scales as e N and is considerable for N 1. As a result, in many applications, metastable states of systems with longrange interactions can be considered as stable states. However, for moderate values of N , or close to a critical point, the lifetime of the metastable states is reduced since the barrier of free energy decreases. In that case, the fluctuations become important and the mean field approximation is no more valid. This is the situation considered in this paper. By an appropriate change of notations, our results also apply to bacterial populations experiencing chemotaxis in biology. Their dynamics can be described by a stochastic Keller-Segel model that takes fluctuations into account and goes beyond the usual mean field approximation.