A ticket agent can do whatever they want by doing an on-the-spot reroute. If you are booked in A class on a two class, it is because the tariffs code allows it. When you switch to a two class, the tariffs code would only allow it to be in D. In reality, though, it would be at the discretion of the agent.