I would think "Det finns många bondgårdar längs vägen" would be needed for "there are...". For "Det ligger..." I simply thought it would be "Many farms are situated along the road." So, det ligger is just a fixed expression, similar to det finns? And difference?
Think of more formal English "There lie many farms...". This construction is far more common in Swedish. Using "ligga"/"stå" when describing where things are situated is very common in Swedish. "Skåne ligger i Sverige" for "Skåne is (located) in Sweden".