How to speed up drawing process of output from .tflite model
TL;DR
Introduce coroutines in your code.
Analysis
It is difficult to optimize a code, where multiple parts are missing, like:

what does getIndexOfMax do? Maybe this is the bottleneck
How do results look like? Arrays? Maps? HashMaps?

I found also some strange code parts, like:

Why results?.let {? This can be removed completely.
var pos: Int should be moved inside the inner loop and made a val

Suggestion
I have too little context and I'm not familiar with Android, so the only thing I can suggest is using coroutines. My Example:
suspend fun draw(canvas: Canvas) = coroutineScope {
    val rotated = sensorOrientation % 180 == 90
    var rotatedW = frameWidth;
    var rotatedH = frameHeight;
    if (rotated) {
        rotatedW = frameHeight
        rotatedH = frameWidth
    }

    val multiplier =
        min(
            canvas.height.toFloat() / rotatedH.toFloat(),
            canvas.width.toFloat() / rotatedW.toFloat()
        )
    val w = (rotatedW * multiplier).toInt()
    val h = (rotatedH * multiplier).toInt()
    
    val xw = w / 256f
    val xh = h / 256f
    val rectF = RectF()
    for (y in 0 until 256) {
        for (x in 0 until 256) {
            launch {   // &lt;-----
                val pos = getIndexOfMax(results!![0][y][x])
                if (pos &gt; 0) {
                    val vertical = y / 256f * h
                    val horizontal = x / 256f * w
                    rectF.left = horizontal - xw
                    rectF.top = vertical - xh
                    rectF.right = horizontal + xw
                    rectF.bottom = vertical + xh
                    canvas.drawRect(rectF, boxPaint)
                }
            }
        }
    }
}