Here is the answer to part one.
The speed of the train east is +12m/sec.
Your speed (east) is + 2.6 m/sec.
Your speed is (+12m/sec) + (+2.6 m/sec) = 14.6 m/sec.
When you move west, your speed becomes negative.
For example, if your speed is 2.6m/sec west, we denote it like
-2.6 m/sec. We can find the ground speed for the example:
(+ 12 m/sec) + (-2.6 m/sec) = 9.4 m/sec.
Part 3: If your friend is moving west 18 m/sec, the ground is moving 18 m/sec east according your friend. You need to add that speed to your speed, found in part 2.
I hope you can answer parts 2 and 3. Just follow the principle above. If your final speed is negative, this means the speed is in west direction.