Your thought about the inclined plane moving on the cart would be correct if there was no friction between the cart and the inclined plane.
However, if the whole system moves at velocity of $u$ there must have been some force that held everything together to allow for the cart to accelerate up to this velocity (otherwise the inclined plane would slide back). To visualize this, think about suddenly moving a cart when you go shopping. The items inside the cart slide back if the cart is pushed with too much force. This occurs because the static friction force cannot keep up with the amount of force that is required to allow the objects to accelerate with the cart. Thus, we know that there must be some friction between the cart and inclined plane.
Now, the friction between the inclined plane and cart cancels out the frictional force between the block and inclined plane that tries to move the inclined plane back.