A bob hanging in an accelerating train moves backward. What is the force moving it backward? 
When the train accelerates, the bob would also accelerate with the same magnitude and direction as the train.
From the free body diagram, only tension and weight are exerted on the bob.
I understand how to relate the "horizontal component" of the tension to the acceleration of the bob.
It moves "backward" and in fact its vertical position is different from when the train is not accelerating.
I am not sure whether inertia could explain this situation. What is the force moving it backward/ lifting with the height?
 A: The bob doesn't move backwards at all. The train is moving forwards (according to your reference frame) and if the bob wasn't attached to the train it would remain stationary. Since it is attached to the train there is a tension in the wire (as the top anchor point moves with train and the bottom is attached to the weight, so stretching the wire slightly). The vertical component of that tension (which is in the direction of the wire) counteracts gravity and allows the bob to rise whereas the horizontal component accelerates the weight in the direction of the train. 
A: This is the problem of accelerating reference frames. Newton's first law:

In an inertial frame of reference, an object either remains at rest or continues to move at a constant velocity, unless acted upon by a force

can be seen as a condition for the other laws to hold true. The frame that is moving with the train is obviously an accelerating reference frame, so it is not inertial and we can expect forces where there shouldn't be. These forces that appear in accelerating reference frames are called fictitious forces or pseudo forces. Imagine you are on a very fast merry go round and you place a bucket of water in the center. The water will bulge to the sides of the bucket with no apparent cause (from your frame of reference). This is also an effect of non-inertial frames.
When you do find a frame that is inertial everything works like you expect. Newton's laws hold and there are no fictitious forces. From the frame that is outside the train everything looks fine. The train is accelerating and the bob is pulled along with it, only with delay because the force has to act via the rope. The rope can only exert sideways force if the bob is not hanging directly under it.
A: The answer by rghome is correct when Earth's surface is chosen as the reference frame.
Now consider this with the train car as the reference frame.
According to the Equivalence Principle, the effect of an accelerating frame of reference is identical to a gravitational field.
This means that if you are in the train car (without windows), you have no way of knowing whether...


*

*The train car is accelerating, or

*gravity has increased and the angle of gravitational field has shifted.  In this new gravitational field, the bob is still hanging "straight" and the train car floor is no longer perpendicular to the direction of gravity.


If you were standing in the accelerating train car, it would likewise be hard to distinguish whether...


*

*the car was accelerating, or

*one end of the car had been elevated.

A: Nothing is moving it backward
The train is accelerating, but the bob is not. In order for the bob to be accelerated at the same rate as the train, there needs be a force acting sideways on it. This is effected as the displacement of $\theta$ on $\vec T$- which combined with gravity $m \vec g$ produces a resultant acceleration $\vec a$
A: Gravity!!!
I know you might be surprised with this answer, but it is not the good old classic Newton's gravitation. This is general relativity, which basically states that all laws of physics must be the same irrespective of the reference frame, this symmetry also known as equivalence principle, leads to what we think of as centrifugal forces.  
The equivalence principle states that gravity is just acceleration, which is exactly what is happening here.
There is a very beautiful explanation given by Steven Weinberg, in a short interview. Link- https://youtu.be/0gSomorLJQU
