To understand the microscopic mechanism of the charge order observed in the parent compound of the infinite-layer nickelate superconductors, we consider a minimal three-legged model consisting of a two-legged Hubbard ladder for the Ni $3d_{x^2-y^2}$ electrons and a free conduction electron chain from the rare-earths. With highly accurate density matrix renormalization group calculations, when the chemical potential difference is adjusted to make the Hubbard ladder with $1/3$ hole doping, we find a long-range charge order with period $3$ in the ground state of the model, while the spin excitation has a small energy gap. Moreover, the electron pair-pair correlation has a quasi-long-range behavior, indicating an instability of superconductivity even at half-filling. As a comparison, the same method is applied to a pure two-legged Hubbard model with $1/3$ hole doping in which the period-3 charge order is a quasi-long range one. The difference between them demonstrates that the free electron chain of the three-legged ladder plays the role of a charge reservoir and enhances the charge order in the undoped infinite-layer nickelates.