Translation:I stand in the train.
Yes, you can say "電車で立ちます", but the meaning of the sentence would change slightly. If you say it without the は particle, you are informing that "(someone) stand in the train". The topic is that someone. With the は particle, the topic changes to the state inside the train. "As for when (someone) is in the train, (someone) stand up."
I think that's the best explanation I can give, for now. Sorry if it confuses you more instead.
I think the problem Duolingo has with "stand up" is that it implies taking the action of standing up from a sitting position.
I.e. the sentence たってください translates as "Please stand up" because you wouldn't ask unless they weren't already however it's unlikely you would be sitting in the train and then stand up if you were saying 電車ではたちます.
The proposition "on" is preferable when you are dealing with vehicles you board on (trains, planes, ships, buses), but it's possible to use "in" when it's needed to emphasise the fact that one is inside a vehicle -- "I wasn't caught by the rain because I was in the bus" -- or to avoid ambiguities.
It has to be, "I stand in the train car." Or, "On the train I stand." The original meaning of 'in the train' would be as in, "The car(riage)s and caboose are in the engine's train." That's how the vehicle came in to be called a train, in a modern concrete sense rather than the original abstract one.
The は in では or には has the sole function of predicating its term to the verb. The stand-alone は doesn't imply a comparison to other places either. That would be "電車の方では立ちます。"
"電車の方が良い。" = The train [as opposed to other things] is better. ~= "電車がより良い。" (More like yet/even better?) These never use は but always が.
は does imply comparison. In the most basic form, it is used in pairs.
It is unnatural to remove the contrastive は in these sentences. We can add の方 to these sentenses, but it just work as emphasis.
If we remove half of the sentences from each of the above, the は becomes "standalone" just like the example. But always remember it is because there is another half getting omitted in case of context being clear.
The most natural use of の方 is の方がいい or のほうが好き as in your example. It is to express preferences (coupling with いい、わるい、好き、嫌い、ほしい etc.).
は…が/けど…は is the sentence that is used for comparison. We cannot just say けど is for comparison. The whole sentence srructure does. So I just want to say は is indeed used for comparison R.f. https://dictionary.goo.ne.jp/jn/172815/meaning/m1u/%E3%81%AF/ point 2.
電車の方で立ちます sounds unnatural to me, with my 20 years of Japanese research study.