Overcoming Selection Bias in Statistical Studies With Amortized Bayesian Inference