A multi-gas trace sensor based on tunable diode laser absorption spectroscopy (TDLAS) with two distributed feedback (DFB) lasers is designed, which was applied to measure methane (CH4) and ammonia (NH3) leaked in industrial production. The multi-frequency synchronous modulation strategy was used to drive two lasers simultaneously, where the lasers have a central wavelength of 1653.7 nm and 1512.2 nm, corresponding to the target absorption lines of CH4 and NH3 respectively. A miniaturized multi-pass gas cell (MPGC) is used as the gas absorption cell. Improved wavelet threshold denoising algorithm based on complete ensemble empirical mode decomposition with the adaptive noise (IWTD-CEEMDAN) is applied to improve the SNR of the spectral signals, and the signal-to-noise ratio (SNR) could be enhanced by approximately 26.34 dB. The concentration of CH4 and NH3 is inverted by whale optimization algorithm–bidirectional long short-term memory (WOA-BiLSTM) with a root-mean-square error (RMSE) of 0.691 ppb and 0.111 ppb respectively. The linearity, stability and response time were verified and the determination coefficients (R2) were 0.9994 and 0.9992 for CH4 and NH3. The response time of the sensor is 4.8 s, which satisfies the real-time detection demands and has the RMSE of 43.24 ppb and 11.83 ppb respectively. The limit of detection (LoD) for CH4 is 6.69 ppb with 212 s integration time, and the LoD for NH3 is 3.78 ppb with 36 s integration time, which is obtained by Allan-Werle deviation. The measurement results of CH4 and NH3 concentrations in atmosphere indicate that the sensors provide a reliable method for simultaneous real-time detection of multiple leaking gases.