The electromagnetic wave signal from the electromagnetic field source generates induction signals after reaching the target geological body through the underground medium. The time and spatial distribution rules of the artificial or the natural electromagnetic fields are obtained for the exploration of mineral resources of the subsurface and determining the geological structure of the subsurface to solve the geological problems. The goal of electromagnetic data processing is to suppress the noise and improve the signal-to-noise ratio and the inversion of resistivity data. Inversion has always been the focus of research in the field of electromagnetic methods. In this paper, the three-dimensional borehole-surface resistivity method is explored based on the principle of geometric sounding, and the three-dimensional inversion algorithm of the borehole-surface resistivity method in arbitrary surface topography is proposed. The forward simulation and calculation start from the partial differential equation and the boundary conditions of the total potential of the three-dimensional point current source field are satisfied. Then the unstructured tetrahedral grids are used to discretely subdivide the calculation area that can well fit the complex structure of subsurface and undulating surface topography. The accuracy of the numerical solution is low due to the rapid attenuation of the electric field at the point current source and the nearby positions and sharply varying potential gradients. Therefore, the mesh density is defined at the local area, that is, the vicinity of the source electrode and the measuring electrode. The mesh refinement can effectively reduce the influence of the source point and its vicinity and improve the accuracy of the numerical solution. The stiffness matrix is stored with Compressed Row Storage (CSR) format, and the final large linear equations are solved using the Super Symmetric Over Relaxation Preconditioned Conjugate Gradient (SSOR-PCG) method. The quasi-Newton method with limited memory (L_BFGS) is used to optimize the objective function in the inversion calculation, and a double-loop recursive method is used to solve the normal equation obtained at each iteration in order to avoid computing and storing the sensitivity matrix explicitly and reduce the amount of calculation. The comprehensive application of the above methods makes the 3D inversion algorithm efficient, accurate, and stable. The three-dimensional inversion test is performed on the synthetic data of multiple theoretical geoelectric models with topography (a single anomaly model under valley and a single anomaly model under mountain) to verify the effectiveness of the proposed algorithm.