Insp Shonibare said the men paraded themselves as serving members of the Nigerian Army and also harassed people on the road with the uniform.
The duo of Mohammed, 45, and Omoluodero is facing a two-count charge of impersonation and unlawful possession of Nigerian Army uniforms.
They pleaded not guilty to the charge.
Police Prosecutor Olakunle Shonibare told the court that the accused committed the offences on June 8 at 10.00 p.m. at Ogere on Lagos -Ibadan Expressway.
Insp. Shonibare said the men, who paraded themselves as serving members of the Nigerian Army, were also caught harassing people on the road with the uniform.
According to him, the accused have been demised from the Nigeria Army.
The offences contravened Sections 109(a) and 110(a) of the Criminal Laws of Ogun 2006.
The Magistrate, Mr Idowu Olayinka, granted the accused N200,000 bail each with two sureties each in like sum.
Hearing in the case has been adjourned until July 7.