2007 Yaris sedan shuts down going uphill with AC and fan going full-tilt?'
Leading causes for an engine to shut down under load, like going uphill, are clogged fuel and/or air filter. After those easy to check items, it could be a clogged exhaust, like the catalytic converter, or a bad fuel pump system. Could be defects in spark or fuel delivery that might be cured just with an extensive tune-up. If the engine revs in gear, but the car accelerates slowly, you likely have transmission slipping which points to a need for serious attention from a transmission professional.