1. A school is bigger than an elephant.

2. A school building is bigger than an elephant.

(Which one is right?)

3. She tried to write with a pencil.
4. she tried to write in pencil.

(Are both OK? Why do we not use 'a' after 'in'?)

All are correct.

Our use of articles seems to be more idiomatic than logical.