I have been using markers in the timeline and pressing Ctrl + B to change the active camera throughout my Blender animation. When I press play in the 3D viewport it changes the active camera at the markers as I want it to, but when I render the animation, the view stays on the first active camera and doesn't change.
Make sure that you don't have View > Local Camera enabled in the 3D Viewport. If this is the case, your animation will only be rendered from the camera which is selected there.
If you have a second 3D Viewport where the option is disabled, then this viewport will correctly show the switching between cameras. Only the Local Camera viewport will use just one camera.
The strange thing however is, when I test it, as soon as I have a second viewport where the switching works, it works in rendering, too. So if my answer doesn't help we maybe need your file to investigate further.