System size and beam energy effects on probing the high-density behavior of nuclear symmetry energy with pion ratio