This seems blatantly unconstitutional. Even civil servants and soldiers have a right to free exercise of religion outside working hours.
Even soldiers and civil servants have their First Amendment rights at all times. Soldiers sometimes following protocols to exercise them difficult but they are not denied those rights.