It's up to your DM.
We don't have any rules about what has to be true for a cranium rat swarm to form.
We don't know if there are checks involved, we don't know how long it takes, we don't know if the cranium rats have to be mentally compatible, and in particular we don't know how many cranium rats it takes to form a swarm. (You've suggested that 18 cranium rats should be correct, and you derived that number by dividing the hit points of the swarm by the hit points of a rat, but that is your house rule and not necessarily correct.)
It would be an error for us to say "yes you can do this", because someone might then point their DM to the answer and say: "look, rpg.stackexchange says you have to allow this!" and we shouldn't be issuing house rules for you.
I do think this would be a cool thing to have happen, but it would have to be done with the DM's cooperation anyway since you're unlikely to have 18 player character druids in the same campaign.
Yes, they would still benefit from Expertise in Wild Shape
As stated in the part of the description of the druid's Wild Shape feature you quote:
You also retain all of your skill and saving throw proficiencies, in addition to gaining those of the creature. If the creature has the same proficiency as you and the bonus in its stat block is higher than yours, use the creature’s bonus instead of yours.
In addition, another bullet point in the Wild Shape feature description says:
You retain the benefit of any features from your class, race, or other source and can use them if the new form is physically capable of doing so. However, you can’t use any of your special senses, such as darkvision, unless your new form also has that sense.
So, to see whether your Expertise class feature is retained, we need to look at the description of the rogue's Expertise feature:
At 1st level, choose two of your skill proficiencies, or one of your skill proficiencies and your proficiency with thieves’ tools. Your proficiency bonus is doubled for any ability check you make that uses either of the chosen proficiencies.
Nothing in the feature description specifies a particular anatomy needed to benefit from Expertise (...it'd be weird if it did, honestly). Thus, you do retain the benefit of the Expertise feature.
Putting it all together: You still benefit from the Expertise feature in Wild Shape. You retain all your skill proficiencies in Wild Shape, in addition to those of your new form. And if the creature is also proficient in the same skill, you use whichever total bonus to the skill is higher between yours and the beast's (for a skill you have Expertise in, your own bonus will likely be higher).
Note: Your own modifier for a skill may change depending on the ability score that the skill is associated with. Per the Wild Shape description:
Your game statistics are replaced by the statistics of the beast, but you retain your alignment, personality, and Intelligence, Wisdom, and Charisma scores.
Thus, your own Strength, Dexterity, and Constitution scores are replaced by those of your new form while in Wild Shape. For those skills that are tied to these three scores (or rather two, since Constitution isn't associated with any skills), your modifiers are also changed accordingly.
For instance, if your own Strength modifier is +1 but your new form's Strength modifier is +5, your Athletics skill modifier will increase by 4 - assuming the beast is not also proficient in Athletics with a higher modifier (in which case you would use the beast's Athletics modifier instead of yours).
Correspondingly, your modifier for a skill may actually decrease if the new form is not proficient in the skill and its corresponding ability score is lower. For instance, if you have a Dexterity modifier of +3, and the beast's Dexterity modifier is -2, your modifier for the Stealth skill would actually decrease by 5.
You can determine your new modifiers for the skills associated with Strength and Dexterity by recalculating them based on your new ability score, and then comparing them to the beast's statblock. If the beast is not proficient, you use your own recalculated modifier. If it is proficient, then you compare your recalculated modifier to the modifier given in the statblock; use whichever of the two is higher.
Best Answer
Your reasoning seems sound to me
As a wildshaped druid, you:
In other words, your retain your mental capacity and your character's mind, and thus your memory, creativity and reasoning abilities, so there's no reason that, given the Raven's Mimicry trait, you wouldn't be able to "mimic" the sounds you've heard in life to effectively speak (in any languages you know as a druid) as a Raven.
The only way in which this falls down is that some may argue that language doesn't come under simple sounds, as mentioned in the Raven's Mimicry trait's description:
However, real life ravens can mimic human speech, so what is considered a simple sound vs. a sound too complex for a Raven to mimic, and where the sound of a person saying a word falls into that, is for each DM to decide.
At the very least, I would argue that a single word is a simple sound (simple enough for real life raven's to mimic anyway), and it's the druid's intelligence that can then string those into a sentence, so I would still argue that the fact that the Raven's Mimicry trait calls out "simple sounds" wouldn't stop this from working as you intend.
It's worth pointing out that this differs from Kenku, since Kenku have a curse that prevents them from being able to create new sounds, as they are cursed to be unable to express creativity (as this question goes into).