Quantum approximate optimization of the long-range Ising model with a trapped-ion quantum simulator