I want to clarify that I've already seen this question asked here , but I'm interested in how you'd solve it with the conservation of momentum rather with the relativity mechanism of finding the velocity with respect to the train and then adding the velocity of the train which I already saw here Velocity of the ball after hitting a train.
I have tried doing it for myself but end up getting nowhere, assuming the velocity of the train remains unchanged after collision and no energy is loss in the colision, and the ball is in rest before the collision: $$p_{before}=p_{after}$$ $$Mv=Mv+mv'\Rightarrow v'=0$$ being $M$, $v$ and $v'$ the mass of the train, the velocity of the train and the velocity of the ball after collision.