The failure probability function (FPF) is a function of failure probability that varies with distribution parameters of random inputs, and is required in reliability-based optimization. To estimate the failure probability at each possible value of distribution parameters, it is necessary to conduct a great quantity of model evaluations. This results in a huge computational burden especially in practical engineering applications. The introduction of surrogate models effectively improves the computational efficiency by constructing a cheap-to-evaluate metamodel to approximate the true performance function. However, it is tough to determine which surrogate model is a prior when the performance function is extremely complex or even implicit. Based on the Bayes’ rule and augmented theory, this paper proposes an ensemble model method for estimating the FPF. Since the ensemble model utilizes each individual surrogate's capacity to predict outcomes by using a weighted form to combine numerous surrogate models and eliminates the trouble of seeking a proper individual model, it possesses better estimation accuracy and generalization ability than the individual surrogate model. Several examples have proved that the proposed ensemble model method for estimating the FPF not only further improves the computational efficiency but also gets sufficiently accurate estimation. Finally, the reliability-based optimization of a hydraulic pipeline system under random excitation is solved effectively by the proposed method.