I guess I can't compare apples to apples, since I haven't dayhiked Whitney in a couple of decades.
My marathon experience required several months of training: long-distance runs, with hours of recovery time after each one; quads that ached during the runs and afterwards. Then I could hardly step off a curb for days after the marathons.
But the dayhike oh-so-long-ago, did not require much more than general conditioning for me, except that I was sick with AMS at the summit. I guess I should dayhike the Main Trail again one of these years so I can compare.
But my vote is that the marathon was way harder.