The 204 kilometre stage from Parma to Genova saw a 20 rider breakaway form after a blistering start to racing, with the peloton content to let them go as they went further and further up the road.
Lorenzo Rota (Intermarché-Wanty-Gobert Matériaux) then attacked with 50 kilometres to go on the penultimate climb of the day, the La Colletta, followed only by Gijs Leemreize (Jumbo-Visma) and Stefano Oldani (Alpecin-Fenix).
Hamilton led the chase to attempt to bring them back with a group containing Kelderman, Bauke Mollema (Trek-Segafredo) and Santiago Buitrago (Bahrain Victorious), but the front trio maintained their lead and battled at the finish, with Oldani winning the sprint and the stage.
While they didn't win, Hamilton and Kelderman launched themselves back into overall contention, gaining over eight minutes on the rest of the GC hopefuls back in the peloton.
Hamilton now sits 16th overall, three minutes and 45 seconds back from the maglia rosa, while Kelderman is 13th with a three minute and 8 second gap from Juan Pedro Lopez (Trek-Segafredo) in top spot.
The Victorian said after the stage he planned to utilise his climbing prowess to thin out the break on the La Colletta in hopes of a stage win, but the front trio were too strong for him to do so.
"I knew it was going to be tough there with such a large group to control those moves slipping off the front," Hamilton said.
"I tried to mark that climb as the climb where I was going to try to thin it down to just climbers, and the guys at the front just kept their gap all the way.
"We chopped off four of us over the top of the last climb as hard as we could, but it just wasn't to be today."
While he was one of three BORA-Hansgrohe GC hopes coming into the Giro, Kelderman's mechanical ahead of Stage 9's Blockhaus climb saw teammate Jai Hindley take centre stage as the team's main man. Hindley's stunning performance to win the stage and jump to fifth on GC, where he still sits 20 seconds back from top spot.
With BORA's Emanuel 'Emu' Buchmann also inside the top 10, Kelderman effectively waved goodbye to his own overall aspirations after stage 12 despite moving back to within three minutes of the race leader, Kelderman said after finishing fifth on the day.
"I wanted to go for the stage win but there were too many guys in front, the Dutchman said.
"I was just riding for place five or something. I expected it to open up a little bit later. I think Alpecin and Wanty played really well, they both had one guy in front and they were with more in the front group.
"GC doesn't matter for me anymore. I'm just not good enough on the long climbs.
"It's still really far. I think you have to stand on one minute to be in GC. For me, I'm just not good enough to be able to fight for GC.
"I think Jai and Emu are in really good shape and they can really fight for the podium."
The Giro d'Italia continues on SBS with Stage 13, with some hard climbing until the mid-point of the stage, with a relatively plateau-like run to the finish from there. Watch from 9.10pm AEST on SBS On Demand, with the SBS broadcast starting from 11pm. WA viewers can watch from 9pm AWST on SBS VICELAND.