The position of the man is changing with respect to both the compartment as well as the platform thus, it is in motion relative to both.
A person walking in a compartment of a stationary train is in motion relative to the compartment and is in motion relative to the platform.