Is the expression 学识渊博 usually used in a pejorative sense? For example, as a sarcastic remark in the sense of "pedantic" or "know-it-all"?
No. It's usually used as a commendatory term. But it can be also used in a pejorative sense (the rule is called 褒義貶用).

PS: This is not used in a conversation, or it's an irony.