The First are what we in Pittsburgh calls Incline, but the proper name is funicular:
https://en.wikipedia.org/wiki/Duquesne_Incline
The Second best transit vehicle when it comes to steep hill are Cable Cars, like the one's on San Francisco.
https://en.wikipedia.org/wiki/Cable_car_(railway)#/media/File:11_Cable_Car_on_Powell_St_crop,_SF,_CA,_jjron_25.03.2012.jpg
https://en.wikipedia.org/wiki/Cable_car_(railway)#List_of_cable_car_systems
Side Note: Watch the list of Inclines in Pittsburgh. Two of the now closed Inclines, Castle Shannon SOUTH Incline and the St Clair inclines were Cable car systems not Funiculars.
After the above two system, electric drive is the best to use on steep hills (San Francisco did replace some of its Cable Cars system with Electric Buses for Diesel buses could NOT take the hills, in the 1950s the plan was to replace ALL of the Cable cars with Trolley Buses, but preservation of the Cable Cars, saved the Cable Cars.
As to using the overhead wires of Streetcars, while in theory possible, in reality no. The main reason is to run an electric system you need a complete circuit, i.e. a line to the streetcar or trolley bus and a line away from the streetcar or trolley bus. In the case of trolley buses that return line was through the rails. This same system is used on electric trains. In Trolley buses, you are running on rubber tires and no rails, thus a dual line system is required. Thus you can use the same poles, the same generator of electricity but the wires themselves has to be 100% changed.
Please note do to their using Rubber tires, Trolley buses are able to go up steeper hills then Streetcars could, through streetcars use less electric power do to the efficiency of steel wheels on Steel rails. Most decisions as to Vehicles relate to cost to operate, that in the case of most mass transit systems 80% of the cost are wages not the type of vehicle or method of power. Electric Buses and Streetcars cost more upfront, but last twice as long as a Diesel bus (i.e. Cheaper long term), but the much lower up front cost of the Diesel bus generally wins out over Streetcars or Electric Trolley buses.