probably both, but when it comes down to damages, your insurance will more than likely pay for the damage to them even though you may not get a ticket. happened to me when a young girl pulled a swoop and stop.
NSW? New South Wales??? Anyhow, here in the US the person behind is at fault because legally you are supposed to follow no closer than a full car length for every 10mph the car is going. If you are closer than that you are legally liable for hitting a vehicle in front of you. Thats something we learn when we take our drivers test and get legally licensed. No one actually follows that rule but that doesnt remove our liability. Bet things arent that much different in NSW!