  We investigate hadronic and leptonic scenarios for the GeV--TeV gamma-ray
emission from jets of the microquasar SS 433. The emission region of the TeV
photons coincides with the X-ray knots, where electrons are efficiently
accelerated. On the other hand, the optical high-density filaments are also
located close to the X-ray knots, which may support a hadronic scenario. We
calculate multi-wavelength photon spectra of the extended jet region by solving
the transport equations for the electrons and protons. We find that both
hadronic and leptonic models can account for the observational data, including
the latest {\it Fermi} LAT result. The hadronic scenarios predict higher-energy
photons than the leptonic scenarios, and future observations such as with the
Cherenkov Telescope Array (CTA), the Large High-Altitude Air Shower Observatory
(LHAASO), and the Southern Wide-field Gamma-ray Observatory (SWGO) may
distinguish between these scenarios and unravel the emission mechanism of
GeV--TeV gamma-rays. Based on our hadronic scenario, the analogy between
microquasars and radio galaxies implies that the X-ray knot region of the
radio-galaxy jets may accelerate heavy nuclei up to ultrahigh energies.
