Trait B is gradually decreasing over time mainly due to natural selection and natural selection can cause microevolution (change in allele frequencies), with alleles which are most suitable for environment to become more common in the population and if it continues to happen alleles not suited to the environment with respect to survival and reproduction can become extinct.
It is true that recessive trait is less common than dominant trait but if a trait is decreasing over time it does not necessarily means that it is due to its recessive allele because it could be possible that a recessive trait is more suited to the environment, so it will continue to survive and increase.
Natural selection is a mechanism of evolution, it's the only one that can consistently make populations adapted, or better-suited for their environment, over time.