Two brothers found with cannabis worth more than £18,000 in a police raid have avoided immediate jail time.