score:3
It's technically possible, but I would not recommend it. The fastest trains cover the distance from Delhi to Agra in under two hours, so you would theoretically have six hours, but you need to account for trains being late, likely needing to change terminals in Delhi (most Agra trains leave from Nizamuddin, not New Delhi stn), horrendous traffic in Agra, etc etc. Indian train scheduling is also quite erratic and last-minute bookings are difficult, so you can't just count on hopping on the next train in 30 min if/when something doesn't go according to plan.
That said, Agra is almost on the way to Kolkata, so you would likely gain a few hours if you can avoid backtracking. Any chance you could change your Kolkata train to depart from Agra instead?