For example, Cinderace gets a bright idea and you turns against Moltres and gets burned. When it switches in later it's gonna be a fire type. If it uses pyro ball, will that ball's damage be halved? And even if it stays as a fire type, will it still take burn damage?
Yes, the attack is reduced. You can see it in this replay.
https://replay.pokemonshowdown.com/gen8nationaldexag-1253352578
At first, Cinderace did 24% Damage to Volcarona and got burned, and at the second time Volcarona recieved 12% damage, showing that Atk has been reduced.
Edit:
Note: Burned Pokemon's Base Power of physical moves is halved, not the atk stat.
Hope this helps :)