I'm not sure why the compartments would be moving at different speeds but if the train is moving on a curved track their velocities would be different. If you assume a circular track and the compartments are evenly spaced then the velocity of the middle compartment will be the average of its neighbors.

Why would it be the average of the two velocities. Considering that the train is moving in a circular track, then v1 is pointing in one direction, v2 in another, so the final would be the average velocity of v1 and a component of v2... Am I wrong somewhere... please help me to clear this out.

[tex]\vec v = v_0 (-\sin \theta \hat i + \cos \theta \hat j)[/tex]

The starting point is unimportant on a circular track. If the radius of curvature of the track is much greater than the length of a single compartment then the change in [itex]\theta[/itex] from one to the next is small enough to use the small angle approximation for the trig functions. If the "last car" is at [itex]\theta = 0[/itex] and the "first car" is at [itex]\theta = 2 \alpha[/itex] then the middle car will be at [itex]\theta = \alpha[/itex]

Keeping first order terms, the respective velocities of the cars are

so the velocity of the middle car is the average of its neighbors. Of course you're free to use the full trig functions if you actually know the relative magnitude of the car length and the track's radius of curvature.