If they felt either officer's being there was inappropriate, they should have asked them to leave.
Asked? No, the guards would have ordered
them to leave. Inside that facility Kirk's rank was meaningless.
Perhaps the manner displayed toward Kirk and others had to do with the Starfleet rumor mill.
The detail were likely unknown, but it might have been common knowledge that Kirk was involved in the destruction of the Reliant, getting the Enterprise shot up, his first officer was dead, cadets were dead, and now a section of space was off limits.
Kirk was seen as a hot shot screw-up.