We present results from the analysis of 2997 fundamental mode RR Lyrae variables located in the Small Magellanic Cloud (SMC). For these objects, near-infrared time series photometry from the VISTA survey of the Magellanic Clouds system (VMC) and visual light curves from the OGLE IV (Optical Gravitational Lensing Experiment IV) survey are available. In this study, the multi-epoch Ks-band VMC photometry was used for the first time to derive intensity-averaged magnitudes of the SMC RR Lyrae stars. We determined individual distances to the RR Lyrae stars from the near-infrared period-absolute magnitude-metallicity (PM_Ks_Z) relation, which has some advantages in comparison with the visual absolute magnitude-metallicity (M_V_-[Fe/H]) relation, such as a smaller dependence of the luminosity on interstellar extinction, evolutionary effects and metallicity. The distances we have obtained were used to study the three-dimensional structure of the SMC. The distribution of the SMC RR Lyrae stars is found to be ellipsoidal. The actual line-of-sight depth of the SMC is in the range 1-10kpc, with an average depth of 4.3+/-1.0kpc. We found that RR Lyrae stars in the eastern part of the SMC are affected by interactions of the Magellanic Clouds. However, we do not see a clear bimodality observed for red clump stars, in the distribution of RR Lyrae stars.