Some of the janitorial workers fired two months ago by American University in a cost-cutting effort by the school have reached a tentative agreement with the university that calls for all the workers to return to work with no loss of benefits, union sources said.

Officials at the university and at Local 25 of the Hotel and Restaurant Employes Union, which is representing 94 cleaning service employes, declined to discuss details of the agreement. However, 27 of the workers have already been rehired by the university or by Unified Services, the private cleaning company under contract with the university.

Under the agreement, the workers would be hired either by Unified Services or for other jobs at the university, sources said.

Workers with the most seniority at the school would get jobs first, according to the agreement. Those fired employes not placed in new jobs immediately will be put on a preferential hiring list for any university opening for which they qualify, sources said.

It was unclear yesterday exactly how many of the fired workers will go to work for Unified Services. Since Unified pays less and has fewer benefits than the school, American University officials have agreed to subsidize the difference in salaries and health and welfare benefits for an undisclosed period of time, a source said.

It was also learned that Caspar Harris, treasurer of Howard University and an AU alumnus, acted as a mediator in bringing the two sides together. The agreement in principle will be spelled out in writing in the next five days, sources said.