5/8" drywall will work on the ceilng, and in a garage, I would want to use fire rated even if it isn't required in your instance/locality. You can also get 1/2" sag resistant drywall that is specially designed to handle 24" OC ceiling joists, but I can't find it at the major HI stores online, so this may be a special order.
For the walls, you shouldn't have the same sagging issues as the weight is pulling the drywall to the floor rather than away from the wall. In that situation, the drywall is under a lot of compression force, which it handles well. It's the expansion that drywall doesn't do well with, which is why it's easy to break when one side of the paper is cut.
If you are paranoid about this, then install a fireblock (a standard 2x4 installed horizontally between two studs so that fire cannot freely burn up the wall cavity) in your walls at exactly 4' from the ceiling and use that to give extra support to each piece of drywall and make a stable connection between the two sheets. With 24" wall spacing, my concern is structural, so assuming the current design passes code, I would install the drywall horizontally to connect the maximum number of studs together.