Here is my take on it. It is somewhat similar to what many others have said but I will try to explain in greater detail, so bear with me in terms of length.
Power from engine
First let us understand power-torque relationship for an engine. The working fluid of the engine (expanding combustion gases) apply a torque on the crankshaft. This torque varies with in-cylinder pressure and is net positive (useful) only in the power stroke (one of the four strokes in a 4-stroke engine in most cars). However, let us assume that we have a average net positive torque coming from the engine. This assumption is ok since most automobiles have multiple cylinders that are phase shifted so that at any time at least one or more cylinder are in power stroke.
So lets call this torque $\tau$. The work done by the engine will be $\tau\theta$, or in other words, the average power from the engine will be:
\begin{align*}
&P_e= \tau_{e}N_{e}2\pi
\end{align*}
Power asked for by the wheels
The load on the car comes from 1) friction on the road 2) air resistance 3) $mgsin\theta$ to climb a hill at a slope of $\theta$. Since the car does not revolve around its center of mass but only translates, all the load on the car (friction, wind, gravitational body forces) can be considered as some combined torque that is overcome by the torque applied by the engine. We can further analyse this using free body diagram of wheels, but that a different discussion to be had later. Essentially for a constant velocity car climbing say fixed inclined slope and a fixed frictional/air load, the torque demand is fixed and equal to the resistive load. Lets call this $\tau_w$ (wheel). Next lets us assume we are going at a constant velocity of our choice that translates to a wheel RPM (rev/min) of $N_w$. Don't worry I will get to an accelerating car later. For now:
\begin{align*}
&P_w= \tau_wN_w2\pi
\end{align*}
Since energy is not accumulated in the car's drive-train (assuming the engine parts don't heat up much after warming up) the power produced by the engine is consumed at the wheels. Again this assumption is fairly accurate since most of the fuel energy either goes to the wheels or leaves as exhaust from the engine, other effects such as frictional heating in the transmission fluid etc are negligibly small
\begin{align*}
P_w&=P_e\\
\Rightarrow \tau_eN_e&=\tau_wN_w
\end{align*}
Now lets say the car just got on the slope and you want to maintian the same velocity as before so you slam the accelerator here is what happens. The new load is some $\tau_w$ and the speed you want is $N_w$ so you are asking the engine to deliver $N_w\tau_w$.
If you are in a fixed gear $N_e = GN_w$ where $G$ is the gear ratio. Hence the engine has to deliver a torque of
\begin{align*}
\tau_{e,\; desired} = \frac{\tau_wN_w}{GN_w}
\end{align*}
So, not only you have a desired power, you also desire fixed engine RPM (or at least hope to stabilize at). Essentially you are asking for a desired torque.
Let us see what the engine can give us
Engine Load-Map
A typical engine map looks like the figure below (hand drawn so excuse me for wobbly curves). For now ignore the red circles $A$ and $B$.
Torque comes from the work output given by the combustion gases. So the max torque curve (for any RPM) is when you are putting most fuel (diesel engine) or least throttle (gasoline engine). The curve drawn in the figure is the max torque for each speed. Even this curve has a peak value at some RPM. As you change engine speed initially you are doing good, i.e., increasing air flow speeds into the engine (that allows higher mass of air into cylinder due to greater rate of suction/pressure drop) allowing higher thermodynamic work output and higher torque, but after a certain speed the engine breathing efficiency (volumetric efficiency) goes down, then the cylinder is gasping for air (usually the flow chokes in the intake valve I think). So at high speed the volumetric efficiency goes down,there is less air, you can burn less fuel (even if press full throttle) to keep emissions within limits, and torque from the engine goes down. The power on the other hand keeps going up because it is a product of speed and torque. The increase in speed means more power strokes per unit time even if each stroke gives less torque. So the power peaks almost at max engine RPM.
Now the problem Lets study what happens when you are trying to climb a hill.
Let's say you started climbing the slope and the desired engine speed (for a fixed vehicle velocity you want to hold constant and fixed gear) corresponds to red circle A. You press the gas pedal the engine gives torque $\tau_A$. If the load is such that $\tau_A<\tau_{desired}$ the vehicle will decelerate and $N_e$ will go down. This will make the $\tau_A$ to go down further (you move left on the torque curve) and you will not be able to keep speeds up. In this situation usually you will gear shift to allow engine to rev up more relative to the wheels, but if you are at constant gear you will not be able to accelerate.
Instead if you were at red circle $B$ and $\tau_B<\tau_{desired}$ at first the engine will try to slow down but its torque output will go up now the engine will stabilize to your desired acceleration. So if you started at the correct side of the torque curve speed-wise you can accelerate to your desired velocity.
Gear changes only allow us to jump to the right engine speed to be able to pull this off.
Of course this is assuming that your engine is sufficiently powered in the first place. Otherwise you will go over the hump backwards and then decelerate further. So the power has to work out!
Non-issues
Most cars of today have a fairly powerful engine and are heavy enough that minor things like fuel tank weight, whether the engine is in the front or back, etc are not an issue. A typical sedan is like 1250-1500 kg, only five heavy ppl and a full trunk of luggage can seriously load the car, not its own peripherals. Furthermore engine electronics (with electronic fuel injection, high pressure fuel rail etc) precision solenoid injectors, etc., are robust enough that fuel supply system is never a limiting factor. Engine peripherals are not that underpowered or lossy. Of course you never have a vapor-lock in fuel lines.
It is just a torque-vs-rpm issue, that comes from how well we can breathe and do combustion. Even throttling loses in gasoline engines have been reduced with better acoustically-tuned intake manifolds, refined valve timing, etc. Torque-curves are becoming flatter and flatter. Also one rarely ever goes to max-power situations (around 6000 rpm for typical sedan engine).
I hope I have addressed all issues still unanswered. Like I said I am not saying anything new just explaining it in more detail. There is something about invariance to inverting gravity. That is just a matter of decreasing load. If you come down a hill very fast and you don't brake, well you will gain speed. You will step off the gas, now your engine torque will come down from the max torque curve. Then it depends on how the engine speed torque stabilizes on a lower torque curve (i.e., if you in highest gear and your load requirement is very low) technically your consuming very little fuel in the engine but it is so fast that it will try to run away (highest rpm) but I am sure there are ways to prevent that, and lose power in engine friction (essentially high speed engine braking) but in most cases you will probably brake much much earlier!