Your Firbolg Druid cannot cast their racial Detect Magic as a ritual
The rules for ritual casting are given in the Spellcasting chapter of the basic rules:
Certain spells have a special tag: ritual. Such a spell can be cast following the normal rules for spellcasting, or the spell can be cast as a ritual. The ritual version of a spell takes 10 minutes longer to cast than normal. It also doesn't expend a spell slot, which means the ritual version of a spell can't be cast at a higher level.
To cast a spell as a ritual, a spellcaster must have a feature that grants the ability to do so. The cleric and the druid, for example, have such a feature. The caster must also have the spell prepared or on his or her list of spells known, unless the character's ritual feature specifies otherwise, as the wizard's does.
The key paragraph is the second one, laying out the requirements to be able to cast a given spell as a ritual:
- The caster must have a feature (such as from a class or a feat) which allows ritual casting
- The caster must have the spell prepared or in their list of spells known, unless otherwise stated
Firbolgs do not inherently have any trait which allows ritual casting, so they cannot cast any rituals by default. But your Firbolg is a druid with the druid's Spellcasting feature - which allows them to cast certain rituals:
You can cast a druid spell as a ritual if that spell has the ritual tag and you have the spell prepared.
Unfortunately this doesn't allow them to cast Detect Magic as a ritual, because the Firbolg Magic trait says:
You can cast detect magic and disguise self with this trait, using Wisdom as your spellcasting ability for them.
... but it doesn't state that you have them prepared in a spellcasting sense - you simply have a special ability which allows you to produce their effects once per rest. Since the spell is not prepared, it doesn't qualify for use with the druid's ritual spellcasting - to be able to cast it as a ritual, you'd have to prepare it as a druid spell and use up the space on your prepared spells list.