Render_pre handler should run operator with transfrom_apply I wanna apply the rotation of an object, each time a certian case is true. The problem is, this has to work while an animation renders. So bevore it render the frame x, it checks if the case is true and if it is, then it applys the rotation of the object. I use this in my Rubik's cube rig. The apply_transfrom doesn't work in this case.

Here is the testing .blend:
https://www.dropbox.com/s/hz8nxx87b3wucx4/untitled.blend?dl=0

Open the .blend, run the two script, and press F12. The goal is that the rotation is applied on all cubes. 

Update: I found the solution myself. I use this script here: Apply mesh transformations to primitive_uv_sphere_add()
First see this and compare it with your code:

import bpy
from mathutils import Vector

# call this only once
# it adds vector attribute to all Object entities
bpy.types.Object.vector = bpy.props.FloatVectorProperty()

# design your callback function like this
def test(scenes):
    # select the group
    bpy.ops.object.select_all(action='DESELECT')
    for obj in bpy.data.groups['Würfel'].objects:
        obj.select = True

    # apply rotation
    bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)

    # store the locations
    for obj in bpy.data.groups['Würfel'].objects:
        loc = obj.location
        obj.vector = Vector((round(loc[0], 0), round(loc[1], 0), round(loc[2], 0)))


If you do a test call with test(bpy.context.scene) it should execute without errors.

If you do bpy.app.handlers.frame_change_pre.append(test) it will work fine on every frame change.

When the objects go into render pipeline the transformations are already 'set/converted' so there is really no data to transform in the pre_render handler.