We consider a multicomponent maintenance system controlled by an age replacement policy: when one of the components fails, it is immediately replaced; all components older than a threshold age θ are preventively replaced. Costs are associated with each maintenance action, such as replacement after failure or preventive replacement. We derive a weak derivative estimator for the derivative of the cost performance with respect to θ. The technique is quite general and can be applied to many other threshold optimization problems in maintenance. The estimator is easy to implement and considerably increases the efficiency of a Robbins-Monro type of stochastic approximation algorithm. The paper is self-contained in the sense that it includes a proof of the correctness of the weak derivative estimation algorithm.