they formed towering and precarious vertical neighborhoods , with long cables ferrying wood and brass cable-trams high over the city , while funiculars were carved into the steepest mountains to carry trains of similar cars down to the main city .