I don’t know exactly myself but I do know its fairly common in anime and manga for police to be more community involved and personal with the locals.
I've seen it a lot too, so I went around taking a look at some Japanese sources.
Basically, they have a thing called 補導 (hodou) which is essentially a warning from the police when a "minor" (aged <20, but may have changed when they redefined 成人 to 18 recently) does something bad (more specifically, 不良行為 or 虞犯行為,) but not quite arrestable, with the goal to educate young people and "correct" their path before they become actual criminals. Common acts include underage drinking/smoking, drug use, violence, wandering late at night, and in this case, truancy.
Different from actual arrests, there is no legally binding requirement to follow this warning and it will not appear on your record, but police will keep note (discarded when turn 20), and if there are too many repeat offences, the family court may get involved and any actual crimes committed will be persucated less leniently. Also, parents will definitely be involved, so the two probably have a good reason as to avoid trouble.
Sources (all Japanese):
https://www.ben54.jp/column/crime/1189
https://izumi-law.net/column/shounen/hodou
Further reading (same as above):
Lowering age of adulthood:
https://www.gov-online.go.jp/article/201808/entry-7947.html
虞犯:
https://www.daylight-law.jp/criminal/syonen/guhan/
Family court:
https://ja.wikipedia.org/wiki/家庭裁判所