The random magnetic field produced by nuclear spins has long been viewed as the dominating source of decoherence in the quantum-dot based spins. Here we obtain in both exact and analytical manner the dynamics of spin qubits coupled to nuclear spin environments via the hyperfine interaction, going beyond the weak system-bath interaction and Markovian approximation. We predict that the detailed-balance-breaking produced by chemical potential gradient in nuclear baths leads to the rapid oscillations of populations, quantum coherence and entanglement, which are absent in the conventional case (i.e., Overhauser noise). This is attributed to the nonequilibruim feature of the system as shown in the relation between the oscillation period and the chemical potential imbalance. Our results reveal the essentiality of nonequilibriumness with detailed-balance-breaking for enhancing the dynamical coherence and entanglement of spin qubits. Moreover our exact solution explicitly demonstrates that the non-Markovian bath comprised by nuclear spins can preserve the collective quantum state, due to the recovery of coherence. Finally we propose an experiment using ultracold trapped ions to observe these nonequilibrium and memory effects.