Passive localization and classification algorithms for mixed near-field and far-field sources have mainly been investigated for antenna arrays with regular or symmetrical geometry. However, these algorithms may not be applicable to wireless sensor networks, where spatially distributed sensor nodes form an array of random geometry. This paper proposes squared error norm of residual fitting error matrix (SRFEM) cost function for mixed source localization, which does not place any constraint on the geometry of antenna array. The proposed cost function is optimized using computationally simple swarm intelligence (SI) algorithms. Convergence performance of three SI algorithms, i.e., particle swarm optimization, Whale optimization, and Grey Wolf optimization is investigated to obtain estimates of the source location parameters with a minimal number of iterations or computational complexity. In order to provide robustness for the SRFEM cost function, this paper proposes an impulse denoising technique based on the long-short term memory recurrent neural network (LSTM-RNN). Simulation results confirm that, in the presence of AWGN, the proposed SRFEM cost function outperforms existing techniques based on the uniform linear array and approaches the theoretical Cramer-Rao lower bound even for a fewer number of snapshots. Further, simulation analysis also reveals that LSTM-RNN provides better mixed localization performance under impulse noise as compared to the bounded noise covariance approach at high signal-to-noise values.