How to distinguish these following sentences?
I took 2 sentences from the textbook but I am so confused about the usages of が、で、を
1. 東京駅で電車をあります。Why don't we use 電車があります?
2. にわに猫がいます。why don't we use にわで?
東京駅で電車をあります。
にわに猫がいます。
Note that you're using ある and いる. (あります・います)
They use に.
東京駅に電車があります。
にわに猫がいます。
As you said, 電車があります is right if it wants to say that there is a train. Maybe your textbook is wrong.