If civil penalties are recovered pursuant to Section 25540 or 25540.5, the same offense shall not be the subject of a criminal prosecution pursuant to Section 25541 or 25541.3. When an administering agency refers a violation to a prosecuting agency and a criminal complaint is filed, any civil action brought pursuant to this article for that offense shall be dismissed.