Mg2+/Li+ hybrid batteries (MLHBs), which support the rapid insertion and removal of Mg2+/Li+ bimetallic ions, are promising energy storage systems. Inspired by the Kirkendall effect, ball-in-ball bimetallic sulfides with heterostructures were prepared as cathode materials for the MLHBs. First, a nickel–cobalt precursor (NiCo-X precursor) with three-dimensional (3D) nanosheets on its surface was prepared using a solvothermal method based on the association reaction between alkoxide molecules. Subsequently, the NiCo-X precursor was vulcanized at high temperature using the potential energy difference as the driving force to successfully prepare NiS2@CoS2 core–shell hollow spheres. When used as the positive electrode material for the MLHBs, the NiS2@CoS2 hollow spheres exhibited excellent Mg2+/Li+ ion storage capacity, high specific capacity, good rate performance, and stable cyclic stability owing to their tough hierarchical structure. At a current density of 500 mA g−1, a specific capacity of 536 mAh g−1 was maintained after 200 cycles. By explaining the transformation mechanism of Mg2+/Li+ in bimetallic sulfides, it was proven that Mg2+ and Li+ worked cooperatively. This study provides a new approach for developing MLHBs with good electrochemical properties.