The sentence is grammatically correct. 'Weren't' is the contraction of 'were not', which is the correct past tense negative form of 'there are' for a plural subject ('many cars and buses').
Answer: In the past, there weren't many cars and buses on the streets.