The word "whether" should be used to introduce an indirect question.
For example, "Tell me WHETHER you are considering our plans".
You are indirectly asking, "Are you considering our plans?"
"Whether" can also be used in place of "in case".
For example, "Whether it rains or snows, the roads become very slippery".
In case it rains or snows, the roads become very slippery.
As with your example, the word "whether" can be used as "if" when it is FOLLOWED by a choice or alternative
'I'm not absolutely sure whether I'm sitting in the second OR the first class car''.
Notice the word "OR".
Another example might be, "I'm not sure whether I should order the chicken OR the beef".
With your sentence, you can say,
"I'm not absolutely sure whether I'm sitting in the second OR the first class car''.
or
I'm not sure IF I'm sitting in the second class car'.
Hope this helps.