If it is common service used across the company, writing service makes sense as teams can use different programming languages to consume it. Libraries expect everyone to use same language or that library has to be recreated in other languages & managed.