I know myself well enough to know that the only way I can prepare to do the two mile run within the allotted time is by running outdoors. I can’t get the training I need on an elliptical or treadmill, although I will use the treadmill when it is too cold outside.
I do the elliptical on occasion, but never as a substitute for running.
Whatever works for you!