If videos recorded right before and after have sound, your microphones are working fine. This usually happens because of a temporary camera software glitch, or because your iPhone was connected to a Bluetooth device like headphones or a car system that took over the audio recording for those two clips.
First, check if the audio was accidentally muted inside the Photos app. Open one of the silent videos, tap Edit in the top corner, and look at the yellow speaker icon in the top left corner. If there is a slash through the speaker icon, tap it to unmute the video, then tap Done.
Next, check if your audio is playing somewhere else. Swipe down from the top right corner of your screen to open Control Center, tap the small AirPlay icon in the upper right corner of the media playback card, and make sure iPhone is selected as the active speaker.
If the video is not muted in Edit mode and no Bluetooth devices were connected, the camera app experienced a temporary glitch and failed to attach an audio track to those specific files. Unfortunately, if the audio was never captured during recording, there is no way to recover or generate the sound for those two specific clips.
To prevent this from happening again, restart your iPhone to clear out any background camera glitches. It is also helpful to go into Settings, tap Camera, tap Record Sound, and select Stereo, as Spatial Audio can occasionally glitch during quick back-to-back video recordings.