Simple answer is that with the same weight and aerodynamic drag and with "properly geared" transmissions (which both are) the 362 HP gas WILL out accelerate and go faster on a grade than the 300 HP diesel.
But-- ya, huge BUT, you could run the diesel at peak HP RPM for weeks at a time (see marine applications where this is exactly what happens) but I can't imaging running a gasoline engine at peak HP RPM (over 5000) for very long.
And in the real world, the diesel will generator adequate HP for most conditions at MUCH LOWER RPM because of high torque at low RPM.
Our coach only has a 300 HP Caterpillar 3126, but has 860 lb-ft of torque at 1,440 RPM. You can multiply 860 times a lot slower RPM to come up with functional HP.