Good question. I can’t give you an exact answer because it really depends on the terrain. In general, I usually default to time because that includes both distance and elevation gain in a very general sense.
However, if your indoors and on a treadmill, then I would pick one or the other. If your goal event is steep, go by elevation gain. If it’s lower angle, then distance may be more appropriate.