Pikachu was so upset at beating Samurott with Iron Tail, that it couldn't fight with full power against Lucario (it needed to get revenge against Swanna though)
Or he knew there was no way in heck it could have competed. I mean as a riolu it beat a stage 3 flying type, Pikachu only managed to beat 2 water types. He knew when the throw in the towel and deliberatly botched that final electro ball.