Which lasts longer in the soil? Let's back up here. Almost all the answers above are correct to some degree but are incomplete. Limestone is mined, ground, and screened. The screening separates the different size particles. It starts with 4-mesh (4 square per inch) and runs to 200 mesh - from rock to powder. The manufacturer blends different size particles for different purposes.
The manufacturer can chose a blend of screen sizes different for ag lime than for pelletized lime. Me, I want to look at the label on each bag and see similar blends of screen sizes. That would be a lot of lime passing thru 80 mesh and not so much thru 200 mesh. For any given soil, the time for the pH to increase - AND DECREASE - is dependent of the particle size of the lime. The form of the blend, ag or pelletized is functionally irrelevant.
But, what I see today is a lot of the particles in pelletized lime being very fine - almost all passing thru a 200-mesh screen before being pelletized. Why? Manufactures have found a market for what used to be floor sweepings. Before pelletizing came along it was a waste product.
Fines react quickly raising pH in a short period of time but the effect dissipates just as quickly - given the same type of soil and environmental conditions.
Ag lime probably has a better particle structure and will last longer - or the chemical reaction necessary for a rise in pH will take longer because there are fewer small particles and more bigger but reactive particles.
So, the answer to a simple question is not so simple. The argument that pelletized lime takes longer to breakdown because of the binder is irrelevant. With ample moisture it can happen in days.
After all of that, for small areas where you must hand spread, pick the pelletized lime.
If both of these are labels from a bag of pelletized lime...
Which one would you pick?