For the first example ながい
, I can think of a two reasons why: 1) The person who entered the text didn't really think about it or didn't care, or 2) There are two versions 永い
and 長い
, and the author didn't know which one to use (this probably isn't the case, but you never know). However, there could be other reasons, and as mentioned in the comments "no one but the author knows the actual reason".
For おさない
, did you know there are two readings for 幼い
? There is いとけない
and おさない
, I don't know if that played a role in the author using hiragana, but it is something to think about (いとけない
is generally not used very much any more, but you will still see it on occasion).
Also, it is good to know that in some situations, 漢字 are prohibited. For example, [常用外漢字]{じょうようがいかんじ} will generally not be used in newspapers because they are not part of the official set of characters to be taught. Also, words like 障害
are usually written as 障がい
recently because 害
has a negative meaning. Also, 子供
is written as 子ども
and there is some controversy over this, but I will leave the reason behind that a mystery.