This is the toughest situation in which to make a shift. The problem is that the tension on the chain is working against you as you struggle up and hill. When a front derailleur shifts to a smaller sprocket, your shift lever does nothing but put slack in the cable, and the spring in the derailleur actually makes the shift. But when you are pedaling very hard struggling up a hill, the tension of the chain on the chainring teeth is greater than the spring tension in the derailleur. Thus the derailleur moves enough to the rub the chain but not enough to push it off the chainring to the smaller sprocket. By understanding this, you can learn how to overcome it. You need to make your shifts earlier, before your pedal rate slows and before you have excessive tension on the chain. Shift while you are still spinning easily and as soon as or just before your pedal rate starts to drop due to the uphill. This takes some practice, because, as you have learned, if you wait a bit too late, you get in trouble. If you find yourself in that situation, put in a couple of hard pedal strokes to give yourself momentum, and then easy off on the pedals for 1-2 revolutions while you make the shift. This is called soft-pedaling - keeping up the cadence but with a drop in pedal pressure.
Also note that, as you have discovered, the rear derailleur will shift under tension much better than the front. And the front derailleur will shift off the largest sprocket easier if you are in the middle of the rear cassette, not in the smallest outside rear sprocket. This is a function of chain angle. It's not good to be riding in the smallest rear sprocket and the middle or inner chainring for very long (cross-chaining), so it's good habit to shift to the middle of the rear cassette first before shifting out of the large chainring.
Oil is good, grease is better.
2007 Peter Mooney w/S&S couplers/Terry Butterfly
1993 Bridgestone MB-3/Avocet O2 Air 40W
1980 Columbus Frame with 1970 Campy parts
1954 Raleigh 3-speed/Brooks B72