In this paper we prove exact forms of large deviations for local times and intersection local times of fractional Brownian motions and Riemann-Liouville processes. We also show that a fractional Brownian motion and the related Riemann-Liouville process behave like constant multiples of each other with regard to large deviations for their local and intersection local times. As a consequence of our large deviation estimates, we derive laws of iterated logarithm for the corresponding local times. The key points of our methods: (1) logarithmic superadditivity of a normalized sequence of moments of exponentially randomized local time of a fractional Brownian motion; (2) logarithmic subadditivity of a normalized sequence of moments of exponentially randomized intersection local time of Riemann-Liouville processes; (3) comparison of local and intersection local times based on embedding of a part of a fractional Brownian motion into the reproducing kernel Hilbert space of the Riemann-Liouville process.