You need work to get something done. And that source of work in our case is engine power, measured in kW or HP. That power gets out of the engine via rotating shaft. Calculating power of a rotating shaft is quite easy if you have the speed (RPM) and torque. You just need right units and you multiply them. And that is a tricky bit for (especially turbocharged) car engines. You have a lot of torque at low RPM, so your power (multiplication of the two) is not as big. As RPMs rise, torque drops slightly, but as RPMs rise faster power goes up. At some point torque starts to drop faster and your power decreases even as RPMs rise. So the max power in N and D mode could be the same, as at that (max power) RPM, torque output in both modes is the same. But at low RPM torque output in D mode is higher, therefore power output at low RPMs is higher, therefore you accelerate faster.
Tricky thing when comparing diesel and petrol cars is the gearbox. Gearbox is a device that can change RPMs and torque, but only so that their multiplication stays the same (so in reality power stays the same). That is why it is really important that your gearbox is calculated properly. If you have two cars that drive with the same speed and have the same size tires, those tires rotate at the same speed. When you accelerate you add torque to them. If you multiply added torque with rotating speed of tires you get power, which should be the same (if there are no losses in transmission) as the power that your engine is capable to give out at the RMP that the engine is currently running on.
So who will accelerate faster, 170HP diesel or 170HP petrol? The one that has better calculated gearbox and a driver that knows how to use it.
I hope I helped clarify something and not add more confusion.