Two agencies had widely differing culture problems, and senior civil servants fixed them with the basics