Although the gravitational/inertial force causing the pendulum to tilt in the same way in both cases (see Equivalence principle link of @zhermes) thus not allowing you to see whether you are on accelerating or on the slope, you will probably be able to feel the difference.
The reason is that although the force parallel to the train is equal (which causes the pendulum to behave in the same way), the normal force acting on you is not so depending on the value of $\arctan\left(\frac{a}{g}\right)$ (whether it is sufficiently larger than 0) you will probably be able to feel whether you are on the incline or not.
[ADDITION after discussion with @markovchain]
Thinking along the line of parallel and normal forces I have to expand my answer a bit: a RIGID pendulum will look exactly the same on the flat and sloped part. A FLEXIBLE pendulum however, will be straight when moving up the slope, but curved when accelerated on the horizontal surface because it will have both a component pulling it to the left and a component (gravity) pulling it down.