Questions & Answers about Я зевала в электричке и поняла, что ночью опять не смогла выспаться.
Not quite. Электричка usually means a suburban / commuter electric train, the kind people take between a city and nearby towns or suburbs.
So в электричке is more specific than just в поезде (on the train / in a train). A Russian learner will hear электричка very often in everyday speech.
Because after в when it means in / on / inside a place, Russian uses the prepositional case.
- электричка → dictionary form, nominative
- в электричке → prepositional singular
So:
- в электричке = on the commuter train / in the commuter train
This is the normal way to say location here.