A state or local agency required to investigate a complaint alleging agricultural activity on a farm is in violation of specified laws, rules, or ordinances and where such activity is not found to be in violation of such specified laws, rules, or ordinances may recover its full investigative costs and expenses if a court determines that the complaint was initiated maliciously and without probable cause.