Trolley problem 
A trolley of mass $300kg$ carrying a sandbag of $25kg$ is moving uniformly with a speed of $27km/h$ on a frictionless track. After a while, sand starts leaking out of a hole on the floor of the trolley at the rate of $0.05kg/s$. What is the speed of the trolley after the entire bag is empty? 

I do not seek the exact answer to the problem. I know a force will act on the trolley because the mass is changing (and force is proportional to the rate of change of momentum) but where it acts is what confuses me. Where would the force act? 
 A: First Rule of Conservation of Momentum problems and Momentum Change problems:  Define what the system is!  Second Rule:  Don't change the definition in the middle of solving the problem.
In this case, one could define the system as the trolley plus sand. So it's simple to calculate the total momentum of this system.
In addition, the sand will presumably stop moving along with the trolley as it dribbles out of the trolley, past the frictionless track and onto the ground.  So the momentum of this system will change, because the ground is exerting a horizontal force on the sand part of the system, acting to slow the sand to a stop.  This is the answer to the specific question;  however, there is no force from the ground on the trolley part of the system.
However:
The first part of your question implies that the mass of the system is changing.  This is impossible in a properly defined question.  The sand lying on the track was, and remains, part of the system as defined above.
If we instead define the system as the trolley, and the sand as some another system that just happens to be travelling close to the trolley in the same direction, then the problem becomes much simpler.
There is no horizontal force acting on this new system (the trolley). The ground only exerts a force on the sand, not part of this new system. The momentum and velocity of the trolley thus remain unchanged.
A: In some ways this is a "make you think" question because it has a very different answer from a question which has sand added to the trolley.
What you have to realise is that at the instant the sand leaves the trolley its horizontal momentum does not changed so no horizontal force needed to be applied by the trolley on the sand to make it leave the trolley.
Since the trolley exerted no force on the sand the sand did not apply a force on the trolley.
So the trolley (the system) continues to travel at constant velocity because it has no horizontal force acting on it.
