I would say overall, those casualty numbers were not expected prior to the start of the war. The first major battle of the USCW, Bull Run in 1861, was the costliest battle in US history at the time it was fought. So not only was the level of casualties much higher than during the Mexican War, it was unprecedented in US history. Of course Bull Run was not particularly costly by the standards of the USCW. There are widespread accounts from both North and South surprised at the death toll.
There was hope in the North of a quick victory in the USCW. This is apparent prior to Bull Run, but you can also see that prior to and during the Peninsular Campaign in the summer of 1862. Both publicly and privately, General McClellan expected his Peninsular Campaign to result in a decisive battle that would result in the Union taking Richmond and effectively ending the rebellion. So even among the professionals fighting the war, there was some expectation that it would not drag on for as long as it did.
You can see similar outrage for casualties after the battle of Shiloh in the Spring of 1862. This was a tactical victory for the North, but the high casualty rates caused widespread shock and condemnation from the public. There were widespread calls to remove Grant from command after Shiloh. The rumors surrounding his drinking and unpreparedness were in part fueled by outrage over the high loss of life from the battle.
Even if you fast forward to the Overland Campaign in 1864, many in the North were shocked at the cost of Grant's campaign against Lee to take Richmond. Grant's strategy was questioned privately and publicly throughout the campaign as one battle after another resulted in high casualties and Richmond not falling. Even at this stage with the South on the ropes, there were public calls for a negotiated peace (admittedly some of this was from Copperheads). So even after nearly 4 years of fighting, the public sentiment around casualties was something that had to be carefully managed.
Which is probably why the war lasted so long. To end it what was required was a massive expenditure in life that I think the North just wasn't prepared to stomach until the end. Even McClellan's Peninsular Campaign was an effort to outflank the Southern forces guarding Richmond in a fruitless attempt to take the city w/out having to engage in something like Grant's Overland Campaign.
Sources I am drawing from include Chernow's excellent biography Grant, and the likewise excellent, To the Gates of Richmond: The Peninsula Campaign, by Sears.
Edit: I realize writing this I don't talk about the Southern public's reaction to casualties. I honestly don't have a good grasp of the public mood in the South. I don't recall that being a focus nearly as much as Northern attitudes in the books I have read.