Poland, Hungary can take complaints to court: EU chief