Most take one v as side a and the other v as side b, with the hypotenuse as resultant v.If the gun is fired while pointing in the A direction, then the A side is the muzzle velocity and the the resultant velocity( along the hypotenuse) is the vector addition of the trolley velocity and muzzle velocity. It will be greatwer than either trolley or muzzle velocity. If muzzle velocity is 100 m/sec and trolley velocity is 15 m/sec, then the velocity along the hypotenuse will be ~101.119 m/sec. The bullet will strike the target at this speed and at an angle of ~8.627 degrees from straight in.
After leaving the muzzle, we can not increase the speed of the bullet.
And because of the cross displacement, a longer flight path and time.
If we use the magnitude trolley v for side b, and the magnitude of bullet v for the hypotenuse.......the resulting side a........will be the resulting magnitude of velocity of incident impact.
The side a, will always be shorter than the hypotenuse(muzzle v)........less velocity.
Does the impact hole in wall, go straight in? Does that hole go deeper with trolley velocity? The bullet's mass remains constant.
How does this really work?
What makes you think that the hypotenuse velocity would be equal to the muzzle velocity?