Western Isles Council has sought a judicial review of the government’s decision to overrule the closures.
Ministers are contesting the action, maintaining they acted reasonably and in accordance with their obligations under the Schools (Consultation) Act 2010.
Under the act, an authority proposing to shut a rural school has to have special regard to any viable alternative, the likely effect on the community and the likely impact of different travel arrangements.
The council earmarked primaries at Shelibost in Harris and Carloway in Lewis for closure, along with discontinuing S1 and S2 education at Shawbost and Lionel in Lewis, claiming rolls had been falling for 30 years.
The hearing, before Lord Brailsford, continues.