They're etymologically unrelated, "bikeshedding" having been coined in our field and our lifetime, but semantically not too far apart. The main difference I see is that pettifogging connotes an ulterior motive which the described activity serves to conceal, while bikeshedding explicitly denotes the service of no purpose save the burnishment of the bikeshedder's ego.
(The term "bikeshedding" is insufficiently defined, in that it implicitly excludes the social reasons always underlying human behavior, which is why I these days prefer the word I used. Honestly, having been away from it now something over a year, even the simple jargon of the field begins to take on a queasy pseudocolor in my mind, the stinking sinus-stinging yellow-green of a revolted gut revolting. Thinking back over the rattle of acronyms and half-words that used to shape my days comes to be like thinking back over times I have been feverishly ill. Perhaps for once in my life I am on the leading edge of something.)