The OP asked that we ignore drag, etc. If we do the answer is yes, the hilly route would take the same time as a flat one
Not true. See my earlier post about harmonic mean.
Yes, even without drag or rolling resistance, the time will depend on the elevation profile (see brachistochrone problem).
Frankly, this is a bit of an ill-posed problem which invites many-flavored answers, but the gist is that you want some metric that represents the amount of climbing effort.
In general, total energy is all that matters. You can compare rides of any length or effort distribution by total energy expenditure, and anything else is biological or psychological.